Library lisp routine

Library lisp routine

rfigueroa24PK4
Enthusiast Enthusiast
1,775 Views
44 Replies
Message 1 of 45

Library lisp routine

rfigueroa24PK4
Enthusiast
Enthusiast

Hello all, 

So I tried to have Chatgpt create a lisp routine that would allow me to TYPE a product name into the command line and it search for it in a designated location for it to insert and drop into the model space drawing. For instance, I type in "HD-RXC-4KZ-101" into the command line, and have it search in my C:\CAD\LIBRARY\AV-300 ONE-LINE STANDARD BLOCKS folders where I have multiple different brand folders with all the model equipment in them. it should be able to find it and have me drop it into my drawings. But no matter how I word it, it never works so I gave up lol. Can anyone help me with this situation? Thank you!

0 Likes
Accepted solutions (1)
1,776 Views
44 Replies
Replies (44)
Message 41 of 45

Sea-Haven
Mentor
Mentor

Did you add a # hash to front of the dwg name ? It uses that as the trigger for the error check.

 

#myblock1 

#Ambulance

#HD-RXC-4KZ-101

 

 

0 Likes
Message 42 of 45

rfigueroa24PK4
Enthusiast
Enthusiast

Yes I did, and still nothing. Not sure what Im doing wrong. I copied the lisp completely, named the file GETDWG.lsp, and dropped it into the program. Clicked always load app. But when i type for example #HD-TXC-4KZ-101, all I get is the unknown command error.

 

0 Likes
Message 43 of 45

Sea-Haven
Mentor
Mentor

Not sure what I can offer, here is a movie using code perhaps some one else will try it. Are you using LT2024+ ?

(view in My Videos)

 

You will still see the error message but you just ignore. Did you run it in a blank dwg if so did you do a Zoom Extents as the new block can be small or super large.

0 Likes
Message 44 of 45

Sea-Haven
Mentor
Mentor

If it is still not working the only thing I can think of is that there is a issue with the directory or the file name causing the problem. I just made a dwg HD-TXC-4KZ-101 and then used the program and it worked fine.

 

What I did 

Opened HD-TXC-4KZ-101 and drew a circle around objects.

Copied the circle object

Closed HD-TXC-4KZ-101 no save

Opened a blank dwg then pasted the circle then did zoom extents

Loaded program typed #HD-TXC-4KZ-101 and got this

SeaHaven_0-1785800125408.png

 

 

0 Likes
Message 45 of 45

rfigueroa24PK4
Enthusiast
Enthusiast

Hello, Ill give this a try but that seems a bit crazy to do lolol. Been busy so Ill let you know when I try it out. Otherwise Ill just go back to your original lisp you provided which worked. Ill just need to type the command and explode every time but I know it worked.

0 Likes