Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lisp question--how to entmake a pline

0 views
Skip to first unread message

Barry Shevitz

unread,
Jul 13, 2000, 3:00:00 AM7/13/00
to
can anybody help me finish writing this program:
I want draw a line or pline that connects blocks with a numbers in a
certain attribute. the user types the numbers, the program finds block
whose attributes contains the numbers, and draws a pline between them.
I've written the code for getting the input, finding the appropriate
block, and placing the block's insertion pt into a variable

But how do I procede from here? the number of user inputs
varies--sometimes only 2 blocks, sometimes 10 or more. How do I use
(entmake) to create a line or, preferably a pline, from a list of
points, when the number of points changes each time?

TomD

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to
You need to entmake a head entity, then 'foreach' pt, entmake a vertex, then
entmake a seqend.

It's really quite easy, although it seems difficult before you try it out.
I know I have something that you can use for a 'sample'. If I can dig it up
here, I'll send it to you.

BTW, a LWPolyline would probably be easier to entmake, however I haven't yet
tried that.

Barry Shevitz <bar...@netvision.net.il> wrote in message
news:396DFE8C...@netvision.net.il...

Helmut Schepers

unread,
Jul 14, 2000, 3:00:00 AM7/14/00
to

Barry Shevitz <bar...@netvision.net.il> schrieb in im Newsbeitrag:
396DFE8C...@netvision.net.il...

> But how do I procede from here? the number of user inputs
> varies--sometimes only 2 blocks, sometimes 10 or more. How do I use
> (entmake) to create a line or, preferably a pline, from a list of
> points, when the number of points changes each time?


Hello,

here a example

;;--------------------------------------------
(setq counter 0)

(entmake (quote (( 0 . "POLYLINE")(62 . 5)(66 . 1)) ))

(repeat (length Liste) ;; Liste contents the points

(setq counter (1+ counter))
(setq Vertex_dxf_42 (car (nth counter Liste))) ;; if Vertex_dxf_42
/= 0.0 go to next point with an ARC
(setq Vertex_dxf_10 (cadr (nth counter Liste))) ;; Vertex_dxf_10 it's a
Point of the Polyline

(entmake (list (cons 0 "VERTEX") Vertex_dxf_42 Vertex_dxf_10))

(setq counter (1+ counter))

); repeat

(entmake (quote (( 0 . "SEQEND"))))
;;--------------------------------------------

I hope it's help you

Greeting from Germany

Helmut


0 new messages