subodh_gis Posted February 16, 2017 Posted February 16, 2017 This is the part of code. I am getting the ; error: bad list of points How we will make list of points pt1 and pt2 to pass in ssget "_F". please help (setq txt (entsel "Select text: ")) (setq oText (vlax-ename->vla-object (car txt))) (setq pt1 (vlax-safearray->list (vlax-variant-value (vlax-get-property oText 'InsertionPoint)))) (setq x1 (car pt) y1 (cadr pt)) (setq angle_obj (vlax-get-property oText 'Rotation)) (setq pt2 (polar pt (+ angle_obj PI 90) 0.3)) (setq x2 (car pt) y2 (cadr pt)) (setq ss (ssget "_F" '((x1 y1) (x2 y2)) )) Quote
Roy_043 Posted February 16, 2017 Posted February 16, 2017 Instead of this: '((x1 y1) (x2 y2)) Use this: (list (list x1 y1) (list x2 y2)) Or this: (list pt1 pt2) Note: The pt variable seems undefined. Quote
tombu Posted February 16, 2017 Posted February 16, 2017 Take a look at http://www.lee-mac.com/quote.html Quote
subodh_gis Posted February 16, 2017 Author Posted February 16, 2017 Thanks for response but when I using (list (list x1 y1) (list x2 y2)) error: bad argument type: lselsetp nil but when we write x y coordinates then the code runs fine. like (ssget "_F" '((0 0) (1 1))) so finaly how to make pt1 and pt2 x y coordinate list. Quote
tombu Posted February 16, 2017 Posted February 16, 2017 This should explain it somewhat: (defun c:try ( / txt oText pt1 x1 angle_obj pt2 x2 ) (setq txt (entsel "Select text: ") oText (vlax-ename->vla-object (car txt)) pt1 (vlax-safearray->list (vlax-variant-value (vlax-get-property oText 'InsertionPoint))) x1 (car pt1) y1 (cadr pt1) angle_obj (vlax-get-property oText 'Rotation) heigth_obj (vlax-get-property oText 'Height) pt2 (polar pt1 (+ angle_obj 45) heigth_obj) x2 (car pt2) y2 (cadr pt2) ss (ssget "_F" (list (list x1 y1 0.0) (list x2 y2))) ) (command "line" (list x1 y1) (list x2 y2) "") ; Draw fence line so you can see location. (sssetfirst nil ss) ; Set ss as selected and gripped. ) Quote
Roy_043 Posted February 16, 2017 Posted February 16, 2017 @tombu: Are you saying the first fence point must be a 3D point, but the other points can be 2D? Quote
tombu Posted February 16, 2017 Posted February 16, 2017 No, just that it doesn't matter. Example code nothing more. Started to simplify using the TEXTBOX function, but really (setq ss (ssadd))(sssetfirst nil (ssadd (car(entsel "Select text: ")))) would do the same thing. Quote
subodh_gis Posted February 16, 2017 Author Posted February 16, 2017 @tombu Thanks Bro ! Its working Now. Quote
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.