(defun c:PIEL ()
(setq pt1 (getpoint "\nPick the first point: "))
(setq pt2 (getpoint pt1 "\nPick the second point: "))
(setq pt3 (getpoint pt2 "\nPick the third point (90 degrees): "))
(setq an (* (/ 180 pi) (angle pt2 pt3)))
(command "_.PLINE" pt1 pt2 "")
(command "_.PLINE" pt2 pt3 "")
(command "_.INSERT" "JAI" pt2 1.0 1.0 0)
(setq obj1(entlast))
(princ (strcat "\nRotation angle: " (rtos an 2 2)))
)
(princ)
Solved! Go to Solution.
Solved by ec-cad. Go to Solution.
Solved by ec-cad. Go to Solution.
Solved by ec-cad. Go to Solution.
Solved by ec-cad. Go to Solution.
i want i pick p1 p2 p3 block object insert and angle is p2 p3 its work only one direction its an angle is 0 but other wise its insert but angle its opposite direction dont want dynamic action its just i test for block
Looks like I'll have to check the direction of both plines.
The are 16 combinations of which way they are applied.
But in any case, the elbow needs to be at 0 or 180 it looks like.
I'll try a little later, lunch is ready.
ECCAD
OK, I got it working.
Attached is the Lisp and the sample drawing, with notes.
Seems that there were only 8 combinations of those pline connections,
since pt3 can only be 'perp' to pt2, 0, 90, 180 or 270.
Anyway, have fun with it.
Cheers
ECCAD
I am sure that can be done, with pline 1 (any angle), and 'type' of elbow, e.g. 30 / 45 / 90 or
whatever they come in standard angles. You would have to provide the various blocks for
the elbows ..
The way it would work is:
1 - getpoints pt1, pt2 - any direction.
2 - would ask for what type of elbow.
3 - based on the answer, would ask for a 3 rd point pt3 for 'general' direction
3.1 - Optionally, ask for Length of 2nd pipe.
4 - based on general direction from pt2 to pt3, would calculate a (polar) point / angle for drawing
the 2nd pline - based on degrees of elbow and distance.
5 - would then apply 2nd pline pt2 to pt3, and set in the elbow, rotated to suit.
Do you think that's a solution ?
ECCAD
Are you using all PVC fittings ? They come in 22.5, 45 and 90 as far as I can see on the web.
Can you upload a drawing with all the blocks you will have to use ?
ECCAD
Attached is a Lisp to try out. Does 22.5 / 45 / 90 degree Elbows at any Angle.
Crude blocks also attached.
You need to make your own blocks similar to attached, and edit the Lisp
to set your 'path' to where your blocks are located, or place them in a \support
folder, and edit the (command "_insert" (strcat path blk) pt2 "1" "1" rot) line to be:
(command "_insert" blk pt2 "1" "1" rot)
The Web site won't allow more than (3) attachments, so I'll attach the 90ELBOW to another
response.
ECCAD
Can't find what you're looking for? Ask the community or share your knowledge.