![]() |
【转帖】how to know the featurebodyparts name if it is selected using mouse
how to know the feature/body/parts name if it is selected using mouse
as topic says. i just want to get its name if the feature/parts/body is selected with mouse and insert its name into database. but, the first step to get its name is not easy for me now. any suggestion will be appreciated! vb2008.net express c#,asp.net,xml solidworks 2009,driveworks sql server 2005 express mastercam x2,fanuc ansys,cosmos ------------ edmonton,ab canada t6j 2n8 edited: 03/06/2009 at 11:52 am by qinghai jin hey, try this code: dim swapp as sldworks.sldworks dim swselmgr as sldworks.selectionmgr dim swselection as sldworks.component2 dim swpart as sldworks.modeldoc2 dim swpartname as string 'create solidworks object swapp = createobject("sldworks.application") 'get active document swpart = swapp.activedoc 'set the selectionmanager swselmgr = swpart.selectionmanager 'get the component of selected object swselection = swselmgr.getselectedobjectscomponent2(1) 'get the name of the component swpartname = swselection.name2 'show name in messagebox msgbox(swpartname) its written in vb.net should work for you! local time: 10:14 pm (austria) edited: 03/06/2009 at 04:13 pm by georg draxler it works well. thanks! georg vb2008.net express c#,asp.net,xml solidworks 2009,driveworks sql server 2005 express mastercam x2,fanuc ansys,cosmos ------------ edmonton,ab canada t6j 2n8 quick |
所有的时间均为北京时间。 现在的时间是 09:54 PM. |