Jump to content

How to make list of point entity


subodh_gis

Recommended Posts

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)) ))

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...