1. 程式人生 > >怎麽精確控制solidworks裏面的表格的位置

怎麽精確控制solidworks裏面的表格的位置

left 誤差 raw rmi swd term 不可 col true

手工移動是不可能的,總是有點誤差,雖然有主動捕捉的功能。

        public void SetTablePosition(TableAnnotation table, double x, double y)
        {
            table.Anchored = true;
            DrawingDoc swDrawing = (DrawingDoc)currentDoc;
            if (table.Anchored == true)
            {
                //Sheet sheet = v.Sheet;
Sheet sheet = swDrawing.GetCurrentSheet() as Sheet; TableAnchor tableAnchor = sheet.get_TableAnchor((int)swTableAnnotationType_e.swTableAnnotation_General); //Determine type of table anchor table.AnchorType = (int)swBOMConfigurationAnchorType_e.swBOMConfigurationAnchor_BottomLeft;
// Set the new position of the table anchor double[] dNewPosition = new double[2]; dNewPosition[0] = x; dNewPosition[1] = y; tableAnchor.Position = dNewPosition; } table.Anchored = false; }

一個sheet裏面的一種表格只能有一個定位點。

所以當需要精確定位多個表格的時候,可以先表格先設置為附著點屬性為true,定位完成後,設置為false。這樣就不會相互幹擾!

怎麽精確控制solidworks裏面的表格的位置