chprop: A point is needed (???)

Trying to change layer for selection set. After selecting entities every time getting an extra message "A point is needed…." and command prompt is finished with Property to change options [Color/LAyer/…]:

What is missing in command below?

(command "_.chprop" (ssget) "" "_la" "0" "")
Select entities:
Select entities:
Opposite Corner:
Entities in set: 2
Select entities:
2 found.
Entities in set: 2
Select entities:
A point is needed. Please try again.nil

Thank you

Comments

  • This line of LISP worked for me on a test drawing. Potentially it is something to do with the entities you're trying to work with.

    I would try separating the selection set out from the command, as it will make it easier to see where the problem is coming from. It also allows you to employ some error checking to check that you have in fact created a selection set to work with.

    (defun C:Lay0 (/ sset)
    (princ "\nSelect entities to change to Layer 0") ; prompt the user
    (setq sset (ssget)) ; select entities to work with
    (if sset ; If a selection set has been created
    (command "_.CHPROP" sset "" "_LA" "0" "") ; Then change the entities to layer 0
    (princ "\nNo entities selected") ; Otherwise promt the user
    )
    (prin1) ; make a quiet exit
    )

    Using SSGET in combination with filters also can be useful to avoid issues, as it can allow you to limit selection to just the entities you want to work with. e.g.

    (ssget '((0 . "LINE,CIRCLE")))
    

    Lee Mac has a great reference on SSGET usage https://www.lee-mac.com/ssget.html

    Jason Bourhill

    CAD Concepts Ltd

    cadconcepts.co.nz

  • gennadykh
    edited July 29

    Thank you, Jason, for fast respond!

    Problem solved: selection set was altered in loaded BRX app.

    As in bare bone Bcad both yours and mine commands works fine.

    Thank you for support!

    Best regards,

    Gennady