cmo73
Guest
salve, dopo la presentazione, ecco il moi problema....
lo scopo sarebbe quello di selezionare delle viti tipo "brugola" (in drawing view) e mostrare unicamente l'incasso...
good morning
sorry for my english ....
i have a problem with a macro,
when i select the features manually, and i ask to show the hidden edges, it works ... (drawing file with parts or assemblies)
but with a macro, with <<selectbyid2>> function, the features are properly selected, i think ...
then, with the command, << swapp.runcommand swcommands_popup_show_hidden, "blah blah" >>,
in assemblies drawing view, it does not work correctly, all the hidden edges are shown ...
in parts drw, it's ok.
why???
can you help me?
thank you a lot
greetings
cmo
attached: a picture of the problem, parts, assembly and drawing, and the macro...

dim swapp as sldworks.sldworks
dim part as sldworks.modeldoc2
dim mymodelview as sldworks.view
dim boolstatus as boolean
dim longstatus as long, longwarnings as long
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
boolstatus = part.extension.selectbyid2("cut-extrude2@part1-2@drawing view2", "bodyfeature", 0, 0, 0, false, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("cut-extrude2@assem1-2@drawing view3/part1-1@assem1", "bodyfeature", 0, 0, 0, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("cut-extrude2@assem1-2@drawing view4/part1-1@assem1", "bodyfeature", 0, 0, 0, true, 0, nothing, 0)
swapp.runcommand swcommands_popup_show_hidden, ""
part.clearselection2 true
end sub
a sinistra i tratti dell'asta della vite, non sono visibili, ed è quello che desidero....

lo scopo sarebbe quello di selezionare delle viti tipo "brugola" (in drawing view) e mostrare unicamente l'incasso...
good morning
sorry for my english ....
i have a problem with a macro,
when i select the features manually, and i ask to show the hidden edges, it works ... (drawing file with parts or assemblies)
but with a macro, with <<selectbyid2>> function, the features are properly selected, i think ...
then, with the command, << swapp.runcommand swcommands_popup_show_hidden, "blah blah" >>,
in assemblies drawing view, it does not work correctly, all the hidden edges are shown ...
in parts drw, it's ok.
why???
can you help me?
thank you a lot
greetings
cmo
attached: a picture of the problem, parts, assembly and drawing, and the macro...

dim swapp as sldworks.sldworks
dim part as sldworks.modeldoc2
dim mymodelview as sldworks.view
dim boolstatus as boolean
dim longstatus as long, longwarnings as long
sub main()
set swapp = application.sldworks
set part = swapp.activedoc
boolstatus = part.extension.selectbyid2("cut-extrude2@part1-2@drawing view2", "bodyfeature", 0, 0, 0, false, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("cut-extrude2@assem1-2@drawing view3/part1-1@assem1", "bodyfeature", 0, 0, 0, true, 0, nothing, 0)
boolstatus = part.extension.selectbyid2("cut-extrude2@assem1-2@drawing view4/part1-1@assem1", "bodyfeature", 0, 0, 0, true, 0, nothing, 0)
swapp.runcommand swcommands_popup_show_hidden, ""
part.clearselection2 true
end sub
a sinistra i tratti dell'asta della vite, non sono visibili, ed è quello che desidero....
