Insert Elbow Lisp

Insert Elbow Lisp

smallƑish
Advocate Advocate
1,832 Views
31 Replies
Message 1 of 32

Insert Elbow Lisp

smallƑish
Advocate
Advocate

smallish_0-1740992406668.png

Select two pipe blocks
Find their intersection point and calculates the rotation.
It inserts an "ELBOW" block at the intersection point with the correct rotation

 

If it can be automated with lisp please help me 

 

Thank you 

 

0 Likes
Accepted solutions (4)
1,833 Views
31 Replies
Replies (31)
Message 21 of 32

smallƑish
Advocate
Advocate

Noted, thank you for your reply even though you are busy.

 

 

0 Likes
Message 22 of 32

tanbqtb03
Contributor
Contributor

Would you like to help me to update code for any other fitting, same function with elbow (elbow block), such as tee block, 45° wye.....or something? Thanks

 

0 Likes
Message 23 of 32

Moshe-A
Mentor
Mentor
Accepted solution

@smallƑish hi,

 

attached the new version

 

a change in commands name 

1. elbowL previously was elbow

2. elbowT this is new

3. l2m - no change

 

enjoy

Moshe

 

 

 

Message 24 of 32

smallƑish
Advocate
Advocate

That's absolutely perfect! going beyond what I requested in the forum. I'm sure this will be helpful for many draftsmen in the future, letting them enjoy piping drafting instead of seeing it as a tedious task. It's simply awesome! Thank you so much!

Message 25 of 32

smallƑish
Advocate
Advocate

@Moshe-A 

 

Another question 

 

Currently, we cant able to run the lisp to previsly selected objects, instead we need to select one by one after initiating the comand.

 

For example, if I select a MLine, use the "Select Similar" option, and then run a command, it asks me to select objects again. Also, "Select Similar" doesn't work after that.

 

Any chance to make it possible?

0 Likes
Message 26 of 32

DOODLEANU
Enthusiast
Enthusiast

I know you are asking about this. 

DOODLEANU_0-1742375386491.png

which is not possible to code. coz see how complicated to just see 8 angles are there. so keep this way while you work. so easy to copy paste without rotating much that's what I do.

Message 27 of 32

Moshe-A
Mentor
Mentor

@DOODLEANU ,

 

"which is not possible to code"

 

almost what can be done manually, can be done Programmatically 😀

 

 

 

 

Message 28 of 32

tanbqtb03
Contributor
Contributor

I can't code, so I don't know how difficult it is to code, sorry bro

0 Likes
Message 29 of 32

smallƑish
Advocate
Advocate

@DOODLEANU try this 

(defun c:IN45 (/ INPOINT LASTBLOCK)
  (setq INPOINT (getpoint "\nPick insertion point: "))  
  (command "INSERT" "YOURBLOCK" INPOINT 1 1 0) ; Replace your block name 
  (setq LASTBLOCK (entlast))
  (princ "\nROTATE OR ENTER ANGLE")
  (command "ROTATE" LASTBLOCK "" INPOINT) 
)

 hope you can make the process bit easier.

Message 30 of 32

DOODLEANU
Enthusiast
Enthusiast

why need a code for this ?

DOODLEANU_0-1742379660469.png

use block insertion this option, easy?

0 Likes
Message 31 of 32

DOODLEANU
Enthusiast
Enthusiast

I mean complicated.

0 Likes
Message 32 of 32

DOODLEANU
Enthusiast
Enthusiast

Even coding is not my skill too. but this looks difficult to understand while draw manually. then coding may be very difficult that's what I mean.

0 Likes