Hi , all . I’m very not experienced in this kind of things . I’ve tried to get a script working helping me to export models from my workflow with some basic checks before to export them .
Some how difficult to explain but it should be easy to understand the script
import rhinoscriptsyntax as rs
# seleziona l'insieme dellegeometrie da esportare
modello = rs.GetObjects ( " seleziona il modello " , select=True )
#isola la selezione
if modello :
rs.Command ("_hide")
geometrie = rs.Command ("_selall")
if geometrie :
rs.Command("_hideswap")
if not geometrie :
rs.Command ("_show")
modellofinale = rs.Command( "_SelAll" )
if modellofinale :
rs.Command("_selall _ShrinkTrimmedSrf ")
# verifica che le poli e le srf siano chiuse
solidi = rs.GetObjects(" verifico i solidi " , preselect=True)
if solidi :
rs.Command( " _SelOpenPolySrf ")
verificapoly = rs.SelectedObjects()
if verificapoly:
msg = "ci sono polisuperfici aperte"
rs.Command(" _SelOpenPolysrf")
print msg
if not verificapoly :
rs.Command (" _SelOpenSrf ")
verificasrf = rs.SelectedObjects()
if verificasrf:
msg = "ci sono superfici aperte"
rs.Command(" _SelOpenSrf")
print msg
if not verificasrf :
rs.Command (" _SelDup ")
duplicati = rs.SelectedObjects()
#verifica presenza di duplicati
if duplicati:
msg = "ci sono duplicati"
rs.Command(" _Seldup")
print msg
if not duplicati :
#esporta la selezione
rs.Command (" _selall _-Export _Pause _Version=5 _Browse" )
print "tutto bene"
Basically , let’s say you get 5 groups of 10 solids . I want to export one group and check if any of the geometry is open and if any duplicate .
If I run the script on the debug it does what it should … stop me each time any issue is found and drop a message of what the issue is .
If I run it in a rhino command , Including the script in ! _-RunPythonScript ( … )
it still find the issue but it doesn’t show me the right issue message but all of them .
Seems like it should be forced to stop once each time a ‘msg’ is printed
Anyone knows how to fix it ??
thanks