Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

correct use of DXF (-4. )

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Michiel.Valcke
713 Views, 2 Replies

correct use of DXF (-4. )

Hi, 

I'm pretty rusty at AutoLisp, but I have been recently getting more active with it again.

For a routine I'm creating. I allow the user to pick polylines and I filter them out based on whether they are closed or not. 

So I have the following setq

(setq polygonpolylines 
          (ssget 
                      '((0 . "LWPOLYLINE")
                         (-4 . (70 . 1)(70 . 129)(-4. "OR>"))
                       )
           )
)


I'm filtering both on the 1 and 129 dxf 70 value, because I want to select all closed polylines independent of their plinegen value. 

But somehow I don't get the -4 OR to work correctly, at this point it still only selects polylines with dxf (70 . 1) all closed polylines with plinegen enabled are filtered out, but I want them to be included.

Thanks for your time guys

2 REPLIES 2
Message 2 of 3
cadffm
in reply to: Michiel.Valcke

Hi,

 

; your way, just fixed
(sssetfirst nil

(setq polygonpolylines 
          (ssget 
                      '((0 . "LWPOLYLINE")
                       ;(-4 .       (70 . 1)(70 . 129)(-4. "OR>") ) <- your line
                        (-4 . "<or")(70 . 1)(70 . 129)(-4 . "OR>")
                       )
           )
)
  
)


; smarter, but not easier for you to understand / not so easily to read
(sssetfirst nil
  
(setq polygonpolylines 
          (ssget  '((0 . "LWPOLYLINE")(-4 . "&")(70 . 1)))
)
  
)

 

Sebastian

Message 3 of 3
Michiel.Valcke
in reply to: cadffm

The second way is a lot cleaner indeed, I was so focused on where I went wrong with the (-4 . "or") that I completely forgot that I could just check to see if any value contained the 1 bit.

Thanks a lot

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report