Author Topic: -attedit by specific block info.. odd result  (Read 2537 times)

0 Members and 1 Guest are viewing this topic.

JOSHD0000

  • Guest
-attedit by specific block info.. odd result
« on: February 01, 2007, 05:07:02 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?  :realmad:
thanks
Josh

 

T.Willey

  • Needs a day job
  • Posts: 5251
Re: -attedit by specific block info.. odd result
« Reply #1 on: February 01, 2007, 05:17:23 PM »
Welcome to theswamp.

If all you want to do is remove the '.dwg' from the string, then do it before you put it to the attribute.  Something like
Code: [Select]
(setq DN (vl-filename-base (getvar "dwgname")))
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

JOSHD0000

  • Guest
Re: -attedit by specific block info.. odd result
« Reply #2 on: February 02, 2007, 12:12:43 PM »
Thank you!  That worked perfect! :lmao:
Does anyone know of a free TIF converter for AutoCAD?

Now I have another problem I am trying to figure out.  It is another posting in the link below:

http://www.theswamp.org/index.php?topic=14842.0

T.Willey

  • Needs a day job
  • Posts: 5251
Re: -attedit by specific block info.. odd result
« Reply #3 on: February 02, 2007, 12:39:54 PM »
Thank you!  That worked perfect! :lmao:
Does anyone know of a free TIF converter for AutoCAD?

Now I have another problem I am trying to figure out.  It is another posting in the link below:

http://www.theswamp.org/index.php?topic=14842.0
You're welcome.  About your other problem, I have no idea.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.