DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

Delete line with lenght = 0

Started by Nicolas79, May 19, 2010, 06:21:30 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Nicolas79

Hello,

I need a macro to delete all line with lenght 0.
I search this morning ....

excuse me for my bad english.
In France, we have Designcad V15

Rob S

Put the following into a text file named "deleteZeroLength.d3m"

Works for me in V15

' Macro to delete zero-length lines
'
'
' Set Precision to 1
  Precision 1

' Loop through all entities in drawing
    For J=1 to SYS(9)
          getattr j, type, select
           If type = 1 AND LENGTH(J) = 0 then
select = 1
putattr j, type, select


end if
    next

if sys(80) > 0 then

regen

prompt$ = "Press 1 to delete = ", sys(80),  "entities,  any other key to keep"

print "Number of entities to be deleted = ", sys(80)
input , [prompt$], ts

if ts <> 1 then end


>SelectDelete
{
}
else

input "No zero-length entities found to delete"

end if

End

User since forever

Nicolas79

Thank you.  ;)

You are the Best. (great ???)  8) 8)