Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

-attedit by specific block info.. odd result

2 REPLIES 2
Reply
Message 1 of 3
joshd0000
199 Views, 2 Replies

-attedit by specific block info.. odd result

Below is a portion of a lisp command that we are using. The lisp command works fine. The issue is that one of our users is having trouble with the lisp command. When the lisp is run it deletes a block and reinserts it. It then runs an -attedit on that block to delete a portion of the text. On one persons computer it does not delete the portion of text. If I hit F2 I can see that the routine ran correctly and in the F2 activity history it indicates the function was done properly to delete the portion of text in quesiton. But it does not do it. Can anyone tell me why? Is it a variable? Lisp is below:

(setq ss_2 (ssget "x"
'((2 . "item")))
)
(command "erase" ss_2 "")
(setq DN (getvar "DWGNAME"))
(command "insert" "item" "0,0" "1" "1" "0" DN "qsave")
(command "-attedit" "n" "n" "item" "" "" ".dwg" "")

This is an auto update file command that inserts a block with the drawing file name. I then use -attedit to edit the text to remove the .dwg extension in the text block. Why on one persons computer would this not work? (the last lisp line is the line in question, after entering value to be changed ".dwg", I replace it with nothing "". Why is this not working on one persons PC?
thanks
Josh Message was edited by: joshd0000
2 REPLIES 2
Message 2 of 3
tom_brabant
in reply to: joshd0000

This might be more general than what you want, but if this routine is acting differently upon the _same_ drawing on the one computer, you could check the system variables on that machine against the other autocad installations. There might be a variable saved in the registry on that particular machine that is causing a different behaviour. The attached file could be used to set up a comparison in a spreadsheet. It should generate a tab-delimited table that can be imported into a spreadsheet app.

If you are using internet explorer, you can view it without downloading here:

http://studiobrabant.com/studio/central/acadlsp/sysvars/sysvars.lsp
Message 3 of 3
joshd0000
in reply to: joshd0000

I found another line of code to avoid the problem. thx

(setq ss_2 (ssget "x"
'((2 . "item")))
)
(command "erase" ss_2 "")
(setq DN (vl-filename-base (getvar "dwgname")))
(command "insert" "item" "0,0" "1" "1" "0" DN "qsave")
(command "-attedit" "n" "n" "item" "" "" ".dwg" "")

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost