|
converting dimensions
in
euans,
the simplest way to do that is to switch the sheet format.
so... you only want to increment/decrement dimensions that are not set to use document precision, right?
-handleman, cswp (the new, easy test)
in my case i select a bunch of dimensions and press alt+1 to set them to one decimal, alt+2 for two decimals, alt+3 for three decimals or alt+0 for no decimals. obviously i have macros associated with these keys. is that what you are looking for.
another scenario would be for you to preselect a number of dimensions and press (as an example) alt+d to bring up a window with radio buttons for 0, 1, 2 or 3 decimals which you can select.
give this one a try. run it after you run the other macro you use. it will increment or decrement precision on all dimensions that are not set to the document precision.
code
dim swapp as sldworks.sldworks
dim swdoc as sldworks.modeldoc2
dim swdwg as sldworks.drawingdoc
dim swview as sldworks.view
dim swdispdim as sldworks.displaydimension
dim killflag as integer
dim smsg as string
sub incdecprecision()
set swapp = application.sldworks
set swdoc = swapp.activedoc
if swdoc.gettype <> swdocdrawing then
msgbox "this macro only works for drawing files."
exit sub
end if
smsg = "click ""yes"" to increment, ""no"" to decrement, or ""cancel"" to quit."
killflag = msgbox(smsg, vbyesnocancel, "dimension precision +/-")
if killflag = vbcancel then
exit sub
end if
set swdwg = swdoc
set swview = swdwg.getfirstview
while not (swview is nothing)
set swdispdim = swview.getfirstdisplaydimension5
while not swdispdim is nothing
if not (swprecisionfollowsdocumentsetting = swdispdim.getprimaryprecision2) then
if vbyes = killflag then
swdispdim.setprecision2 swdispdim.getprimaryprecision2 + 1, -1, -1, -1
else
swdispdim.setprecision2 swdispdim.getprimaryprecision2 - 1, -1, -1, -1
end if
end if
set swdispdim = swdispdim.getnext5
wend
set swview = swview.getnextview
wend
end sub
-handleman, cswp (the new, easy test) |
|