Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating a List of points

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
936 Views, 4 Replies

Creating a List of points

Hi there everyone, I am trying to write a routine that I can have the users
select a unlimited amount of points and then once they are done I want to
connect all the points with a pline....once they do this I am going to
change the polyline into a revcloud,, I am totally stumped on how to make
this list of points...Does anyone else have any other solutions?.....Thanks
sooo much,,
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Hope this helps...

(defun c:PickList()
(setq PT_LIST nil)
(while
(setq PT (getpoint "\nPick a point: "))
(if (= PT_LIST nil)
(setq PT_LIST (list PT))
(setq PT_LIST (append (list PT) PT_LIST))
)
)
(if (/= PT_LIST nil)
(progn
(command ".pline")
(foreach PT PT_LIST (command PT))
(command "")
)
)
(princ)
)

Thanks,
Lee Ambrosius
HyperPics, http://www.hyperpics.com

"Mark Douglas" wrote in message
news:8BB037B96A012A9910A0CFB132975A02@in.WebX.maYIadrTaRb...
> Hi there everyone, I am trying to write a routine that I can have the
users
> select a unlimited amount of points and then once they are done I want to
> connect all the points with a pline....once they do this I am going to
> change the polyline into a revcloud,, I am totally stumped on how to make
> this list of points...Does anyone else have any other
solutions?.....Thanks
> sooo much,,
>
>
Message 3 of 5
Anonymous
in reply to: Anonymous

YOU ARE A PRO.......but one little thing.....is there anyway to actually
show the a fainted like line when you a re picking points on a polyline...if
not this is will work thanks soo much......
"Lee Ambrosius" wrote in message
news:30B17F39E7EEB71FC7F89C43AE098D2B@in.WebX.maYIadrTaRb...
> Hope this helps...
>
> (defun c:PickList()
> (setq PT_LIST nil)
> (while
> (setq PT (getpoint "\nPick a point: "))
> (if (= PT_LIST nil)
> (setq PT_LIST (list PT))
> (setq PT_LIST (append (list PT) PT_LIST))
> )
> )
> (if (/= PT_LIST nil)
> (progn
> (command ".pline")
> (foreach PT PT_LIST (command PT))
> (command "")
> )
> )
> (princ)
> )
>
> Thanks,
> Lee Ambrosius
> HyperPics, http://www.hyperpics.com
>
> "Mark Douglas" wrote in message
> news:8BB037B96A012A9910A0CFB132975A02@in.WebX.maYIadrTaRb...
> > Hi there everyone, I am trying to write a routine that I can have the
> users
> > select a unlimited amount of points and then once they are done I want
to
> > connect all the points with a pline....once they do this I am going to
> > change the polyline into a revcloud,, I am totally stumped on how to
make
> > this list of points...Does anyone else have any other
> solutions?.....Thanks
> > sooo much,,
> >
> >
>
>
Message 4 of 5
Anonymous
in reply to: Anonymous

Like so...

(defun c:PickList()
(setq PT_LIST nil)
(initget 32)
(setq PT (getpoint "\nPick a point: "))
(setq PT_PREV PT)
(setq SSA (ssadd))
(if (/= PT nil)
(progn
(setq PT_LIST (list PT))
(while
(setq PT (getpoint PT_PREV "\nPick a point: "))
(command ".line" PT_PREV PT "")
(setq PT_PREV PT)
(redraw (entlast) 3)
(setq SSA (ssadd (entlast) SSA))
(setq PT_LIST (append (list PT) PT_LIST))
(initget 32)
)
)
)
(if (/= PT_LIST nil)
(progn
(command ".erase" SSA "")
(command ".pline")
(foreach PT PT_LIST (command PT))
(command "")
)
)
(princ)
)

Thanks,
Lee Ambrosius
HyperPics, http://www.hyperpics.com

"Mark Douglas" wrote in message
news:8AE420AD60CA222D0BEB401E6D9962EB@in.WebX.maYIadrTaRb...
> YOU ARE A PRO.......but one little thing.....is there anyway to actually
> show the a fainted like line when you a re picking points on a
polyline...if
> not this is will work thanks soo much......
Message 5 of 5
Anonymous
in reply to: Anonymous

No need for acrobatics, just call command & draw the polyline:

(command "_.PLINE")
(while (=(logand(getvar "CMDACTIVE")1)1)
(command pause)
)
;;once command returns, you can get the entity association list of the
last entity,

(setq elist (entget(entlast)))

;;and modify it to your liking.

If you prefer, you can get the list of points and create the entity
without calling command, using either Active X or (entmake).

By "change the polyline into a revcloud," I am assuming you want to do
something like 1) check the length of pline segments 2) add/delete
vertices if necessary to control the length of segments 3) check the
direction of the pline to see which side is "outside" 4) add a bulge
factor to each segment to get the "cloud" effect.

If you have ACAD2004, the ability to "cloudify" an existing pline thus
is included in the Autodesk supplied REVCLOUD routine.

Even so, you could do it for the programming exercise, if you feel like
it.:)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost