Refine search of Splines

Refine search of Splines

pablo.odriozola
Contributor Contributor
381 Views
4 Replies
Message 1 of 5

Refine search of Splines

pablo.odriozola
Contributor
Contributor

Hi there

I am having problems with the following section of my code

  (sssetfirst nil (ssget "_X" '((0 . "SPLINE"))))
  (c:flatten)

(c:flatten) refers to the FLATTEN command from the Express Tools.

My goal is to convert the Splines into Polylines, but the FLATTEN command seems to not work with closed Splines.

How can I refine the ssget to exclude all closed Splines from the selection?

Thanks!

 

0 Likes
382 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant

Try this expression

(progn (sssetfirst nil (ssget "_X" '((0 . "SPLINE")))) (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "flatten\ry\r"))

 

This should exclude all closed splines (not sure that is your issue)

(ssget "_X" '((0 . "SPLINE") (-4 . "<NOT") (-4 . "&") (70 . 1) (-4 . "NOT>")))

Message 3 of 5

CADaSchtroumpf
Advisor
Advisor

@pablo.odriozola  a écrit :

How can I refine the ssget to exclude all closed Splines from the selection?

 


With a filter on the Bit 70

(sssetfirst nil (ssget "_X" '((0 . "SPLINE") (-4 . "<NOT") (-4 . "&") (70 . 1) (-4 . "NOT>"))))
Message 4 of 5

Sea-Haven
Mentor
Mentor

I got (70 . 1065) for a closed spline and 1064 for open still works as its not 1. 

0 Likes
Message 5 of 5

CADaSchtroumpf
Advisor
Advisor

@Sea-Haven  a écrit :

I got (70 . 1065) for a closed spline and 1064 for open still works as its not 1. 


Did you notice the use of (-4 . "&"): Bitwise AND? LeeMac gives the equivalence and example HERE  or Autocad Help
You can also see all the full 70 bit spline definitions given by phanaem HERE

0 Likes