for some healthy personal pride I tried to spulciate with the utility "com object browser" fields and here is the macro in less than an hour:
save the content in a file named e.g.: "dftprefissosuffisso.vbs"
the name is customizable, the extension is always .vbs
from customizing the controls of the ribbon bar, add an icon, macro section,..... (usual procedure),... select type: "all files (*.*)" or similar.
Code:
' dftprefissosuffisso.vbs
' gianluca vespignani 19/06/2013
' cambia prefisso suffisso
' scritto con notepad ++ : \linguaggio\vb
const sedimension = 488188096
call main()
' il codice che segue può essere incollato su vba-excel per ulteriori sviluppi
sub main()
dim prefisso ' as string
dim suffisso ' as string
dim sovrascrivi
' prefisso e suffisso impostati dall'utente
prefisso = ""
suffisso = "x 45°"
sovrascrivi = true ' attenzione cancella e sovrascrive se i campi = ""
dim objapp 'as solidedgeframework.application
dim objdoc 'as solidedgedraft.draftdocument
dim objsel 'as solidedgeframework.selectset
dim objlist 'as ...
dim objitem 'as ...
' create/get the application with specific settings
'on error resume next
set objapp = getobject(, "solidedge.application")
objapp.visible = true
if err then
err.clear
msgbox ("prima apri solid edge!!!")
'set objapp = createobject("solidedge.application")
'set objdoc = objapp.documents.add("solidedge.draftdocument")
'call objdoc.close
'set objdoc = objapp.documents.open(filedft)
'objapp.visible = true
' todo: verificare se sono nell'ambiente draft o terminare con exit sub
else
set objdoc = objapp.activedocument
end if
on error goto 0 'rigestisce gli errori
' get the active selection
set objsel = objapp.activeselectset
if objsel.count < 1 then
msgbox ("selezionare almeno una quota.")
exit sub
else
for each objitem in objsel
' filtra gli oggetti seleziona e restituisci solo le quote
if objitem.type = sedimension then
'campi:
if sovrascrivi or prefisso <> "" then
objitem.prefixstring = prefisso
end if
if sovrascrivi or suffisso <> "" then
objitem.suffixstring = suffisso
end if
' campi di tipo string utilizzabili, tested by "com object browser"
'.superfixstring = "apice" (string)
'.subfixstring = "pedice" (string)
'.subfixstring2 = "pedice2" (string)
end if
next
end if
' release objects
set objapp = nothing
set objdoc = nothing
set objsel = nothing
' msgbox("finito.")
end sub