|
get drawingview properties
i have a drawing document open. the drawing has multiple sheets. on sheet1, i have the drawing view selected. this is a sheet metal flat. how can i extract the model name of the part in the view? i have tried some of the examples and can't get them to work. i am looking for a vba solution/idea this time. this is going to be a simple macro.
any help is appreciated!
tony szuta
cswa, cswp, cswp-smtl
getreferencedmodelname
view.getreferencedmodelname() works nicely.
kevin kenny, cswp
sw 2009 sp3.0
hp xw4300
answer got it.
sub main()
dim swapp as sldworks.sldworks
dim swmodel as sldworks.modeldoc2
dim swselmgr as sldworks.selectionmgr
dim swview as sldworks.view
dim swdrawmodel as sldworks.modeldoc2
dim sheet as object
dim x as integer
set swapp = application.sldworks
set swmodel = swapp.activedoc
set swselmgr = swmodel.selectionmanager
set swview = swselmgr.getselectedobject5(1)
set swdrawmodel = swview.referenceddocument
set sheet = swapp.activedoc.getcurrentsheet
smodelname = swview.getreferencedmodelname
x = len(swdrawmodel.gettitle)
sheet.setname left(swdrawmodel.gettitle, x - 7)
end sub
thanks guys!
tony szuta
cswa, cswp, cswp-smtl
intel core2 quad (q6600 @ 2.40 ghz)
nvidia quadro fx 4600 sdi
solidworks 2008 sp 4.0 (x32 & x64)
solidworks 2009 sp 2.0 (x32 & x64)
quick |
|