Lisp for drafting welded 'T' profile

Lisp for drafting welded 'T' profile

miroko
Enthusiast Enthusiast
2,878 Views
21 Replies
Message 1 of 22

Lisp for drafting welded 'T' profile

miroko
Enthusiast
Enthusiast

Hello,

 

People at office would like to have a lisp which will draw a ‘T’ welded profile. This ‘T’ is really simple profile, example attached.

Could you help on that one?

 

Would be great if lisp would do following after command is started:

 

1. After command is started a dialog box is appearing saying: ‘’Specify web height’’.

 

2. Then user write dimension and click ‘OK’    

  • if user accidentally write non-digit like '12w' then lisp could warn, i.e. ''Incorrect input, specify digit'')

 

3. Next dialog box appear: ‘’Specify web thickness’’

 

4. Then user write dimension and click ‘OK’

 

5. Next dialog box appear: ‘’Specify flange width’’

 

6. Then user write dimension and click ‘OK’

 

7. Next dialog box appear: ‘’Specify flange thickness’’

 

8. Then user write dimension and click ‘OK’

 

9. Then lisp create block with name ‘’T-WEB.nxn-FL.nxn’’, where ‘n’ are dimensions given in earlier steps. Example T-WEB.300x10-FL.200x15 (but it does not insert it yet). If block with that name already exist then info window appear: ''Such profile was already defined in the drawing, inserting defined earlier block''.

 

10. Window appearing on screen with message: ‘’Specify insertion point’’

 

11. User click ‘OK’ and then user have to click on screen to show insertion point.

 

12. Lisp insert this block at the insertion point (at current layer)

  • If block with that name already exist then just inserts the already defined block.

 

I tried to make it using actions in the AutoCAD but always was something missing or not fully correct. And additionally since the T profile alone is just beginning, as they also like to have lisp for T-profile with some ‘passages’, then ‘actions’ are actually out of question. I hope it is not too time consuming or complicated for a lisp.

 

I would very much appreciate if someone could help with the lisp above, the other ones would be ‘next step’, if you would find time (thinking would be total 4 lisps).

 

Attached dwg shows also the T 'orientation' (flange at the bottom).

 

 

Regards

miroko

Accepted solutions (2)
2,879 Views
21 Replies
Replies (21)
Message 21 of 22

Kent1Cooper
Consultant
Consultant
Accepted solution

@miroko wrote:

.... I think that first 'wt' need not be changed but just axis position defined slightly different. Could you take a look?

....
          "_.mirror" "_last" "" pt "@0,1" ""
.... 


It does appear in your image that 'wt' has been slid over from being in the center.  Try changing that line to:

 

              "_.mirror" "_last" "" (polar pt 0 (/ wt 2)) "@0,1" ""

Kent Cooper, AIA
0 Likes
Message 22 of 22

miroko
Enthusiast
Enthusiast

 

@Kent1Cooper

Thank you for the fixing code.

Now it is working nicely!

 

@CADaSchtroumpf

Thank you also for the code, it is actually very interesting.

Will take a look on this further.

0 Likes