View Full Version : Polylines with common base point?
Mr Cory
2007-02-28, 11:01 PM
Hay, im often having to draw up existing plans and 90% of the time the measurements are all taken from a base line. I was wondering if it was possible to create a lisp that draws polylines from a common base point?
kennet.sjoberg
2007-02-28, 11:38 PM
:confused: I do not understand Hay, im often having to draw up existing plans and 90% of the time the measurements are all taken from a base line. I was wondering if it was possible to create a lisp that draws polylines from a common base point?
Mr Cory
2007-03-01, 12:12 AM
K Um... Basically i want to be able to pick a base point and draw multiple plines from the same base point without having to draw pline enter drawline pick base point etc. It would be so you picked the base point put the crosshair in the direction that the plines wil be drawn and then start typing in the dimensions, and CAD with draw the plines from the same base point. Basically like a running dimension...
0 1000 1500 2400 3600
______________________________________________________________
Here there would be four plines which all start from 0
You might want to add a picture to that explanation. ;)
Mr Cory
2007-03-01, 12:24 AM
Dam the numbers were meant to be spaced out grrr. Does this help?
K Um... Basically i want to be able to pick a base point and draw multiple plines from the same base point without having to draw pline enter drawline pick base point etc. It would be so you picked the base point put the crosshair in the direction that the plines wil be drawn and then start typing in the dimensions, and CAD with draw the plines from the same base point. Basically like a running dimension...
0 1000 1500 2400 3600
______________________________________________________________
Here there would be four plines which all start from 0
The first point is 1000 from the baseline, correct? The second point is 1500 from the baseline. Is this correct?
If the above is correct, does the polyline go from 0 to 1000 to 1500 to 2400 to 3600 to ...?
aaronic_abacus
2007-03-01, 12:40 AM
;Attached are two autolisp programs to draw polylines by a base point.
;SBP sets the base point and PBB draws the polyline from that point.
(DEFUN C:SBP ()
(PROMPT "\n*SET BASE POINT* ")
(SETQ BP (GETPOINT "Specify base point: "))
);END SBP
(DEFUN C:PBB ()
(PROMPT "\n*POLYLINE BY BASEPOINT* ")
(COMMAND "PLINE" BP)
(PRINC)
);END PBB
Mr Cory
2007-03-01, 01:35 AM
Thats what im after! Is their any way to make it end the pline command after each pline and start the PBB command again?
aaronic_abacus
2007-03-01, 01:36 AM
Just press <ENTER> to start the command again.
Mr Cory
2007-03-01, 01:50 AM
As part of the lisp though?
ReachAndre
2007-03-01, 02:52 PM
Are you looking for something a little closer to this?
;Basepoint polyline
(defun c:bpp ()
(if
(not bppl)
(setq bppl (getpoint "select point for polyline basepoint: "))
)
(setq oldbppl bppl)
(command "pline" bppl pause)
(princ)
)[ Moderator Action = ON ] What are [ CODE ] tags... (http://forums.augi.com/misc.php?do=bbcode#code) [ Moderator Action = OFF ]
CAB2k
2007-03-01, 08:24 PM
Maybe this?
(defun C:SBP ()
(initget 1)
(setq *BP (getpoint "Specify base point: "))
)
(defun C:PBB (/ ang dis)
(or *bp (c:SBP))
(initget 1)
(setq ang (getangle *bp "\nSelect or enter the angle. "))
(if (and *bp ang)
(while (setq dis (getdist *bp "\nEnter or pick length. "))
(command "._PLINE" "_non" *bp "_non" (polar *bp ang dis) "")
)
)
(princ)
)
aaronic_abacus
2007-03-01, 09:31 PM
;Attached is PBB.LSP revised to repeat after each polyline ends.
;Press <ESC> to cancel the program when you are done placing polylines.
(DEFUN C:SBP ()
(PROMPT "\n*SET BASE POINT* ")
(SETQ BP (GETPOINT "Specify base point: "))
);END SBP
(DEFUN C:PBB ()
(PROMPT "\n*POLYLINE BY BASEPOINT* ")
(SETQ LP 1)
(WHILE LP
(COMMAND "PLINE" BP)
(SETQ LP2 1)
(WHILE LP2
(IF (= (GETVAR "CMDACTIVE") 1)
(PROGN
(PROMPT "\nSpecify next point or [Arc/Close/Halfwidth/Length/Undo/Width]: ")
(COMMAND PAUSE)
);END PROGN
(SETQ LP2 NIL)
);END IF
);END LP
);END LP
(PRINC)
);END PBB
Mr Cory
2007-03-01, 10:36 PM
Thats brillant CHEERS Guys you all been a great help!
Mr Cory
2007-03-02, 02:38 AM
CAB2k, is how would you get the direction of the plines to follow where the cursor is on the screen?
CAB2k
2007-03-02, 08:34 PM
When the prompt is "Select or enter the angle. " just pick a point in the direction you want.
Mr Cory
2007-03-04, 10:15 PM
After using it that i like it now lol just keep forgetting to pick the angle and all the plines end up the wack lol Cheers!
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.