SolidWorks机械工程师网——最大的SolidWorks学习平台

标题: 请问有人知道DrSection怎么用不? [打印本页]

作者: suzyxia78    时间: 2011-11-7 09:55
标题: 请问有人知道DrSection怎么用不?
我想编辑工程图中已经做好的断面图的属性,查API看起来DrSection当中的SetExcludedComponents最像,可是怎么用呀?
[table=98%]Dim instance As Dim VComponents As ObjectDim value As Booleanvalue = instance.SetExcludedComponents(VComponents)DrSection怎么得到,用GetSelectedObject似乎不行,总是说类型不一致
作者: zlsong    时间: 2011-11-7 10:07
Dim myView as Sldworks.View
Dim myDrSection as Sldworks.DrSection
我现在先选中一个图,然后
Set myView=SelMgr.GetselectedObject5(1)
Set myDrSection=myView.GetSection
这样能得到,之后
myCompnent=myView.GetVisibleCompnents
myDrSection.SetExcludedCompnents myCompnent(0)
为什么没用?也没有报错,返回值是False
作者: winsvn    时间: 2011-11-7 10:11
DrSection的帮助文件表述如下
Allows access to query and modify the data that defines a section view.
Use the Accessors link to obtain a list of functions that return this object.
主要表述是允许修改选择的视图.
Dim myDrSection as Sldworks.DrSection 已经做了定义.
下面语句能否帖个图,加深理解.看看能否帮你解决问题,共同提高.
Set myView=SelMgr.GetselectedObject5(1)
Set myDrSection=myView.GetSection
myCompnent=myView.GetVisibleCompnents
myDrSection.SetExcludedCompnents myCompnent(0)




欢迎光临 SolidWorks机械工程师网——最大的SolidWorks学习平台 (https://www.swbbsc.com/) Powered by Discuz! X3.2