MoI discussion forum
MoI discussion forum

Full Version: Script Error when toggeling lines off

From: edwinfuman
25 Jan 2023   [#1]
hey fellow moi people.

at some point in my modeling phase i am not able to disable the lines and i get this error.
and idea whats the matter?
greetings!


Image Attachments:
Screenshot (233).png 


From: pressure (PEER)
25 Jan 2023   [#2] In reply to [#1]
Hi edwinfuman,

That script works for me here. Does it work for you if you start a new file with something simple in it like a box?

If you post your 3dm I'll try and see if the script works here.
From: edwinfuman
25 Jan 2023   [#3] In reply to [#2]
hey.
yes in a new file it works perfectly. it also worked in the beginning but at some point of
the project it stopped working. its not super importent for the project but i was just curious what
could havee caused it to crash.
From: Michael Gibson
25 Jan 2023   [#4] In reply to [#1]
Hi Edwin, I guess it looks like the script will throw an error if you have managed somehow to create a solid/surface object that has no edges in it, which isn't supposed to happen. Maybe there's something like a solid that's squashed down to a point.

If you update your shortcut key script to this does it work ok then? :

script: /* Toggle edge display */ var breps = moi.geometryDatabase.getObjects().getBReps(); var hide = -1; for ( var i = 0; i < breps.length; ++i ) { var edges = breps.item(i).getEdges(); if ( edges.length != 0 ) { if ( hide == -1 ) { hide = !edges.item(0).hidden; } edges.setProperty( 'hidden', hide ); } }


- Michael