Jump to content

Line polyline rectangle circle vertex


maahee

Recommended Posts

Posted (edited)
(defun c:WD ()
  
  (setq pt1 (getpoint "\nEnter start point: "))
  (setq pt2 (getpoint pt1 "\nSelect second point: "))

  (setq mahee (ssadd)) ; create blank / empty selection set
  (command "x" "rectangle" pt1 pt2)
  (ssadd (entlast) mahee)
  (command "_.offset" 0.05 mahee pt1 "")

 (setq ent (entlast))
 (setq vertices '())
 (while (not (null ent))
 (setq vertex (cdr (assoc 10 (entget ent)))
                   
(if (not (null vertex))
    (setq vertices (cons vertex vertices))
 )
 
 (setq ent (entnext ent))
 )
(prin1 vertices)
)

Save  all point in list function of line, circle, polyline and rectangle other objects 

Edited by maahee
Link to comment
Share on other sites

1st (command "rectangle" pt1 pt2)

 

2nd you need to look at objects as get vertices for plines, endpoints for lines, center point circle, start & end & center point for arc.

(cond
((= arc 
((= circle
((= Line
((= lwpolyline
)

 

3rd for pline 

(setq plent (entsel "\nPick rectang"))
(if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent))))))
(princ co-ord)

 

What do you want to do with the points ask now rather than later.

  • Thanks 1
Link to comment
Share on other sites

Posted (edited)

Are you using OSNAP ? It finds what you want, a shorthand type 0SMODE 47 it may be close to what you want.

 

Else have no idea what you want.

Edited by BIGAL
Link to comment
Share on other sites

Posted (edited)

Thanks sir, Yes I use osnap on and off at starting and ending forgot to write in autolisp and I am try to without changing dimstyle, layer colour, text styles ect. of current autocad environment. Connect specific point with line and draw circles and this point use to create object like windows and door. Also using in inside the other autolisp 

Edited by maahee
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...