Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
joshd0000
Posts: 59
Registered: ‎12-18-2006
Message 1 of 3 (74 Views)

-attedit by specific block info.. odd result

74 Views, 2 Replies
02-01-2007 12:07 PM
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
Distinguished Contributor
tom_brabant
Posts: 404
Registered: ‎12-08-2003
Message 2 of 3 (74 Views)

Re: -attedit by specific block info.. odd result

02-01-2007 02:25 PM 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
Valued Contributor
joshd0000
Posts: 59
Registered: ‎12-18-2006
Message 3 of 3 (74 Views)

Re: -attedit by specific block info.. odd result

02-02-2007 09:15 AM 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" "")
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.