As-built lisp update

As-built lisp update

gv6823otG42ZL
Enthusiast Enthusiast
846 Views
9 Replies
Message 1 of 10

As-built lisp update

gv6823otG42ZL
Enthusiast
Enthusiast

a while back, this lisp command was created for me, and it works great. The only issue I am having is with the removal of the P.E stamp. When the Lisp file was given back to me, I changed line 148.   The original line of code is this:(setq PEBLK "Certification MN-Appd"). I changed the line to this: (setq PEBLK "Certification MN-xxxxxxx x xxxxxxxx-Appd"). The x's in my line of code are the engineers name which I have left out for privacy reasons. I thought that if I change that block name to the P.E block for that specific engineer on the drawing, it would still work and I unfortunately broke it. Can anyone provide some input on what I need to change in order for the program to search for a specific engineers P.E stamp and delete it. The block name for all the engineers stamps are Certification MN-xxxxxxx x xxxxxxxx-Appd where the x's are filled in with there name. Any help would be great!

0 Likes
Accepted solutions (1)
847 Views
9 Replies
Replies (9)
Message 2 of 10

paullimapa
Mentor
Mentor

Questions:

1. Does the lisp still work if you change the block name back to the way it was before?

(setq PEBLK "Certification MN-Appd")

2. Could you provide a sample of the drawing the lisp code runs successfully with the original name?

3. Assuming lisp still works with the original block name, have you tried naming the block shorter like with less "xxx"?

4. Are there any strange characters in the new block name that is not alpha or numeric?

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 10

gv6823otG42ZL
Enthusiast
Enthusiast

The Lisp does still work when I change it back to the original block name. I have attached a sample dwg and the original autoMOD lisp command the drawing worked for. I have not tried naming the block shorter, and the only strange character I can see causing the issue is the dash. here is an example of how each block is named. Certification MN-Keegan Larson-Appd

gv6823otG42ZL_0-1674820566876.png

@paullimapa 

0 Likes
Message 4 of 10

paullimapa
Mentor
Mentor

seems to work for me when I renamed the block to: Certification MN-Keegan Larson-Appd

perhaps you can attach a dwg that has that block name and then the automod.lsp that shows the changed block name as well and then we can try that if it still fails for you


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 10

paullimapa
Mentor
Mentor

Try changing the code where it defines PEBLK to this:

(setq PEBLK "Certification MN*")

You can also actually run your own test at the AutoCAD command prompt with the drawing of the title block opened. Zoom into the location of the block and then enter the following:

Command: (setq PEBLK "Certification MN*")

Command: Select

(ssget "_X" (list '(-4 . "<OR") '(-4 . "<AND") '(0 . "lwpolyline") (cons '8 REVLAY) '(-4 . "AND>") '(-4 . "<AND") '(0 . "insert")(cons '8 REVLAY)(cons 2 PEBLK) '(66 . 1) '(-4 . "AND>")'(-4 . "OR>")))

Then you should see it highlight

paulli_apa_0-1674842311037.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 6 of 10

gv6823otG42ZL
Enthusiast
Enthusiast

Try it on this drawing and use this lisp file. I have changed it and it wont work for me for some reason. @paullimapa 

0 Likes
Message 7 of 10

paullimapa
Mentor
Mentor
Accepted solution

That's an easy one...even though the color is RED, the block is not on LAYER: "REVLAY"

But it's on LAYER: "0"

paulli_apa_0-1674857236397.png

So if you want to make sure you select all blocks matching name: (setq PEBLK "Certification MN*")

then you'll have to change the code so that it does not include the LAYER name restriction like this:

(ssget"_X"(list'(-4 . "<AND") '(0 . "insert") (cons 2 PEBLK) '(66 . 1) '(-4 . "AND>")))

paulli_apa_0-1674857477181.png

 

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 8 of 10

gv6823otG42ZL
Enthusiast
Enthusiast

okay so, what would I all change in the program then for it to delete the stamp based off the block name and not have the restriction of the REVLAY layer. I am new to lisp files, so its hard for me to navigate all the programming language

0 Likes
Message 9 of 10

gv6823otG42ZL
Enthusiast
Enthusiast

disregard. I was able to make it work. Thank you so much!

0 Likes
Message 10 of 10

paullimapa
Mentor
Mentor

glad to have helped....

also you may want to consider making the following change as I mentioned to catch all block names matching the pattern:

; (setq PEBLK    "Certification MN-Appd")
 (setq PEBLK    "Certification MN*-Appd") ; change: use this to catch all name versions following this pattern

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes