首页 > 其他 > 详细

怎么精确控制solidworks里面的表格的位置

时间:2018-04-09 13:00:06      阅读:697      评论:0      收藏:0      [点我收藏+]

手工移动是不可能的,总是有点误差,虽然有主动捕捉的功能。

        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里面的表格的位置

原文:https://www.cnblogs.com/hosseini/p/8758842.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!