I Need Help Making Lisp

I Need Help Making Lisp

Anonymous
Not applicable
1,744 Views
18 Replies
Message 1 of 19

I Need Help Making Lisp

Anonymous
Not applicable

Hi Again Family! 🙂

I need Help please. Can someone make a lisp for me? I tried research but i just don't understand the language which causes me to fail over and over trying to make one. I attached a word document showing what i need the lisp to do If anyone is interested in helping this old man. Please see attached and i thank you kindly in advance 🙂

 

i also attached the lisp that helps do some of what i need but need help to add more and cleanup. thanks again fam 

0 Likes
Accepted solutions (1)
1,745 Views
18 Replies
Replies (18)
Message 2 of 19

dlanorh
Advisor
Advisor

Do the layers you are changing TO exist in the drawing? If you need to create them you need to provide more information (color linetype etc), unless you want to just rename the layer.

 

Do the new Blocks already exist in the drawing? Do the new blocks have the same or similar insertion point?

You are using "effectivename", are any of the blocks dynamic or contain attributes?

 

 

I am not one of the robots you're looking for

0 Likes
Message 3 of 19

Anonymous
Not applicable

OMG!! Hi @dlanorh, 🙂 super excited you answered! 🙂

Do the layers you are changing TO exist in the drawing? If you need to create them you need to provide more information (color linetype etc), unless you want to just rename the layer.

(big yes, all layers exist in the drawing)

 

Do the new Blocks already exist in the drawing? Do the new blocks have the same or similar insertion point?

You are using "effectivename", are any of the blocks dynamic or contain attributes?

(Yep!  all blocks exist in the drawing, have the same insertion points and... no, the blocks are NOT dynamic)

Thanks @dlanorh , let me know what you think and thanks again for the response 🙂 

0 Likes
Message 4 of 19

dlanorh
Advisor
Advisor

Sorry about the delay in replying, I was a bit bogged down in another lisp. I know this is a lot to ask, but could you provide your docx file as an excel file. I've got the bits about changing all text to

 

"Standard", height 4.8 and text width 0.85

and the block delete list and text delete on layer

 

but alot of the rest came across corrupted (I don't have "Word" but use "LibreOffice" on Linux)

 

For example for :   Text Items - three columns  "Old layer" "New layer" "settings"

 

and do the same for *Lines and Arcs and Blocks to replace

 

I shall try to get something out over the weekend

I am not one of the robots you're looking for

0 Likes
Message 5 of 19

Anonymous
Not applicable

No Trouble at all! 🙂

please see attached.

let me know if that work and thanks again @dlanorh!!

0 Likes
Message 6 of 19

dlanorh
Advisor
Advisor

Three questions

1. Are all the entities in Model Space?

2. are the "TEXT" entities only TEXT or  TEXT & MTEXT?

3. What is the current TEXT justification or does it vary?

 

When changing the justification of TEXT entities the text invariably moves

I am not one of the robots you're looking for

0 Likes
Message 7 of 19

Anonymous
Not applicable

Three questions

1. Are all the entities in Model Space? Yes

2. are the "TEXT" entities only TEXT or  TEXT & MTEXT? Mostly Text but some random MText

3. What is the current TEXT justification or does it vary? Justification varies

 

Thanks again!!

0 Likes
Message 8 of 19

dlanorh
Advisor
Advisor

@Anonymous wrote:

Three questions

1. Are all the entities in Model Space? Yes

2. are the "TEXT" entities only TEXT or  TEXT & MTEXT? Mostly Text but some random MText

3. What is the current TEXT justification or does it vary? Justification varies

 

Thanks again!!


As the answer to 2 included MTEXT how do you want these justified (if at all) and I'm not certain I can set the text width with MTEXT as I can with TEXT. This is normally controlled by the textstyle. MTEXT can also have the text style overridden in the text string.

I am not one of the robots you're looking for

0 Likes
Message 9 of 19

Anonymous
Not applicable

Ok lets leave Mtext out. its very unusual to find Mtext in the file i receive 

 

0 Likes
Message 10 of 19

dlanorh
Advisor
Advisor

Lisp attached. This has not been tested as I have no exaple drawing to test on.

 

Any problems let me know.

I am not one of the robots you're looking for

Message 11 of 19

Anonymous
Not applicable

OMG so close!!

first off, ... amazing and much appreciated

 

just 2 things that didn't work 

-block replace

-block deletion

 

i attached the dwg for your review 🙂 and thanks again

0 Likes
Message 12 of 19

dlanorh
Advisor
Advisor

I was being over ambitious, will try to sort tomorrow. I know where the problem is so should be relatively easy.

I am not one of the robots you're looking for

Message 13 of 19

Anonymous
Not applicable

Hi again! 🙂

I found that the 4KV text has stayed the same. im not sure if it was included in the lisp 🙂

revised excel attached for whats left 🙂

and again i cannot thank you enough, your GREAT!

0 Likes
Message 14 of 19

Anonymous
Not applicable

i was able to add the 4kv to the lisp. attached below 🙂

0 Likes
Message 15 of 19

dlanorh
Advisor
Advisor
You are replacing Blocks "JWP" "WP" and "E". Should these be added to the purge?

I am not one of the robots you're looking for

0 Likes
Message 16 of 19

Anonymous
Not applicable

yes please

thanks!

Message 17 of 19

dlanorh
Advisor
Advisor
Accepted solution

Attached is update Lisp. It now works for blocks. It was a simple error (I forgot a "setq") in the block replace code. This caused the lisp to error and exit through the error sub routine on the first block (a "replace"). I have upgraded the lisp to remove (command "-purge"). The routine now checks if the block definition is present in the drawing and whether it is referenced somewhere. If it is present in the drawing and not referenced, the block definition is deleted.

 

Running through 2000+ block references (mostly replaces) took some time (10 secs on my machine), so be patient.

 

I am not one of the robots you're looking for

Message 18 of 19

Anonymous
Not applicable

Thanks! Works well. Haven't been able to test it fully so I'll definitely check back in with you. 

 

Best 

0 Likes
Message 19 of 19

Anonymous
Not applicable

tested for over a month now, added new blocks and layers with no issues at all.

thank you soooooo much for all the help with this lisp. 

0 Likes