|
need vb code for dimension override value
i am in need of some code that gets a specific dimension and sets the override value of that dimension to any number i choose.
here is all i could find:
dim instance as idisplaydimension
dim override as boolean
dim value as double
dim value as boolean
value = instance.setoverride(override, value)
this is probably easier than i am making it out to be lol. i don't know what to put to get d1@sketch3 to be an override value of 50. thank you for any help!
-solidworks 2009 sp1
--dell precision m6300-
---intel core2 duo t9300------------------------
----nvidia quadro fx 3600m - 4gb ram----------
hi,
this works for me. have a drawing as the active document and edit the select statement to name a dimension in a view.
dim swapp as sldworks.sldworks
dim part as modeldoc2
dim selmgr as selectionmgr
dim dispdim as displaydimension
dim theval as double
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
set selmgr = part.selectionmanager
boolstatus = part.extension.selectbyid2("rd1@drawing view1", "dimension", 0, 0, 0, false, 0, nothing, 0)
set dispdim = selmgr.getselectedobject6(1, 0)
theval = (50 * 25.4) / 1000 'in meters
dispdim.setoverride true, theval
end sub
scott
quick |
|