几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   SolidWorks二次开发 (http://www.dimcax.com/hust/forumdisplay.php?f=111)
-   -   【转帖】selected plane name and path (http://www.dimcax.com/hust/showthread.php?t=4567)

yang686526 2009-04-12 07:33 PM

【转帖】selected plane name and path
 
selected plane name and path
is it possible to get the selected plane's path, regardless of assembly/sub-assembly location, like how you get the component.name2 path off a part? if so how would you do this? i'm trying to select a plane from either the top level assembly or from a sub-assembly and assign it to an object that i select or get later to activate. trying to do something like this. i think i'm going down the wrong path myself ... lol
dim swcomp as sldworks.component2
dim itemplane as variant
dim itemplanenamesplit as variant
' plane already selected
set itemplane = swselmgr.getselectedobject6(1, -1)
set swcomp = itemplane
' get itemplane name and location
itemplanenamesplit = split(swcomp.name2, "/")
cadcam systems analyst
-solidworks office premium 2009 sp3.0
-solidworks simulation premium 2009 sp3.0
-solidworks flow simulation 2009 sp3.0
-2 cpu (fx-62), 2.0 gb of ram
-window xp pro sp2
-nvidia geforce 7950 gx2 (512mb) 6.14.11.6921
answer duh. i was definitely going down the wrong path. here's the correct path.
dim swcomp as sldworks.component2
dim swentity as sldworks.entity
dim itemplane as variant
dim itemplanenamesplit as variant
set itemplane = swselmgr.getselectedobject6(1, -1)
set swentity = itemplane
set swcomp = swentity.getcomponent
itemplanenamesplit = split(swcomp.name2, "/") ' get itemplane name and location
cadcam systems analyst
-solidworks office premium 2009 sp3.0
-solidworks simulation premium 2009 sp3.0
-solidworks flow simulation 2009 sp3.0
-2 cpu (fx-62), 2.0 gb of ram
-window xp pro sp2
-nvidia geforce 7950 gx2 (512mb) 6.14.11.6921
quick


所有的时间均为北京时间。 现在的时间是 05:55 AM.