wimal Posted February 7, 2018 Share Posted February 7, 2018 (edited) (setq ss nil) (if (and (not (initget "Lap")) (setq ss (entsel "\nSelect fixed line [Lap length] : "))) (if (= "Lap" ss)(progn (setq pick "Y") (setq ss (entsel "\nSelect fixed line : ")) ))) 2nd code is working (setq ss nil) (if (and (not (initget "Lap")) (setq ss (getpoint "\npick point [Lap length] : "))) (if (= "Lap" ss)(progn (setq pick "Y") (setq ss (getpoint "\npick point : ")) ))) Edited February 7, 2018 by wimal spell mistake Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted February 7, 2018 Share Posted February 7, 2018 I have never used initget with entsel or getpoint... What are you trying to achieve? Im sure there is a simpler way... Quote Link to comment Share on other sites More sharing options...
wimal Posted February 7, 2018 Author Share Posted February 7, 2018 I have never used initget with entsel or getpoint...What are you trying to achieve? Im sure there is a simpler way... I need to allow to user to set value of LAP , if user required. Default value is set to 500 Quote Link to comment Share on other sites More sharing options...
Aftertouch Posted February 7, 2018 Share Posted February 7, 2018 And you want the user to be able to set the value of LAP... by selecting an entitie and get its length? so 'LAP' is 500 OR the length of a selected line? Quote Link to comment Share on other sites More sharing options...
Roy_043 Posted February 7, 2018 Share Posted February 7, 2018 Maybe the issue is related to the first letter of the keyword. 'L' has a special meaning when selecting entities: L=Last entity. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 7, 2018 Share Posted February 7, 2018 Here is an example that checks what is picked. Includes L for last which is accepted by entsel. (defun c:aaa ( / obj) (while (setq obj (vlax-ename->vla-object (car (entsel "\nPick objects L for last object")))) (cond ((= (vla-get-objectname obj) "AcDbLine")(setq len (vla-get-length obj))) ((= (vla-get-objectname obj) "AcDbArc")(setq len (vla-get-Arclength obj))) ((= (vla-get-objectname obj) "AcDbCircle")(setq len (vla-get-Circumference obj))) ((= (vla-get-objectname obj) "AcDbPolyline")(setq len (vla-get-length obj))) ) (if (> len 0.0) (alert (strcat "length is " (rtos len 2 2))) (alert "object has no direct length") ) (setq len nil) ) ) Quote Link to comment Share on other sites More sharing options...
satishrajdev Posted February 7, 2018 Share Posted February 7, 2018 Maybe the issue is related to the first letter of the keyword. 'L' has a special meaning when selecting entities: L=Last entity. You are right, Its happening because of L stands for Last entity. Check out this : (setq ss nil) (if (and (not (initget "LAP")) (setq ss (entsel "\nSelect fixed line [LAP length] : ")) ) (if (= "LAP" ss) (progn (setq pick "Y") (setq ss (entsel "\nSelect fixed line : ")) ) ) ) Quote Link to comment Share on other sites More sharing options...
wimal Posted February 7, 2018 Author Share Posted February 7, 2018 Maybe the issue is related to the first letter of the keyword. 'L' has a special meaning when selecting entities: L=Last entity. Yes my friend ,it was the problem. Thanks a lot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.