solidworks二次開(kāi)發(fā)-03-訪(fǎng)問(wèn)特征數(shù)據(jù) 'coder arden 'filename : getchoosed.swp 'date :2005-03-22 'used to get the simple hole infomation dep & dia 'finished lucky !! '------------------------------------------------------------
option explicit dim swapp as sldworks.sldworks dim model as modeldoc2 dim curfeature as feature dim boolstatus as boolean dim featdata as simpleholefeaturedata2 '聲明一個(gè)簡(jiǎn)單直孔對(duì)象 dim component as component2 dim dep as double dim dia as double dim selmgr as selectionmgr dim ncount as integer
sub getselected()
set swapp = application.sldworks
set model = swapp.activedoc
set selmgr = model.selectionmanager
set curfeature = selmgr.getselectedobject5(1) '得到當(dāng)前選中的第一個(gè)特征