View Full Version : Can´t change attributes on a block from commandline!
Tom_Drawer
22nd Oct 2009, 02:33 pm
When i am trying to change attributes to a block via the command line it doesn´t work.
I´ll have to change it from a toolbox.
The problem is that i want to changed it everytime i start a drawing.
I have created a lisp routine and put it in the acaddoc.lsp file to load it automaticly.
(defun c:rev () (command "._insert" "ESYMB_30" "0,0" "" "" "" "0.8" "1.0" "3000" "PÅ"))
(c:rev)
and it returns "nil" From my experience that´s a OK!
ollie
5th Nov 2009, 07:27 pm
When i am trying to change attributes to a block via the command line it doesn´t work.
I´ll have to change it from a toolbox.
The problem is that i want to changed it everytime i start a drawing.
I have created a lisp routine and put it in the acaddoc.lsp file to load it automaticly.
(defun c:rev () (command "._insert" "ESYMB_30" "0,0" "" "" "" "0.8" "1.0" "3000" "PÅ"))
(c:rev)and it returns "nil" From my experience that´s a OK!
Is the block in modelspace or paperspace
i paperspace is it one or all sheets
Tom_Drawer
10th Nov 2009, 07:54 pm
Hi, Ollie!
The block is in the modelspace. Here is the whole problem: an office where i am doing some practice, uses the POINT plug on top on autocad mep 2009. That office has a cad manual that uses symbols in scale 0.8. The problem is when you start a drawing u have to set the symbol size to 0.8 every time. The symbol settings is changed by a toolbox in POINT. I thougt that was a vaste of time so a took a look in POINT and found that the settings was changed by giving a special block some new attributes. so far so good. But when i created the LISProutine to change it automaticly nothing happens with the symbol size :?. I also created a macro that opend the toolbox and maked the changes i wanted same ****, nothing happens. Any ideas
Maybe i´m thinking wrong here:unsure:
/Tom
it is in all sheets
MarcoW
11th Nov 2009, 08:02 am
When i am trying to change attributes to a block via the command line it doesn´t work.
I´ll have to change it from a toolbox.
The problem is that i want to changed it everytime i start a drawing.
I have created a lisp routine and put it in the acaddoc.lsp file to load it automaticly.
(defun c:rev () (command "._insert" "ESYMB_30" "0,0" "" "" "" "0.8" "1.0" "3000" "PÅ"))
(c:rev)
and it returns "nil" From my experience that´s a OK!
I am not shure what you want to do but for me it looks your code is not working too good. Note that I erased 1 " ) " at the end of the insert command:
Command: (command "._insert" "ESYMB_30" "0,0" "" "" "" "0.8" "1.0" "3000" "PÅ")
Unknown command "0.8". Press F1 for help.
Unknown command "1.0". Press F1 for help.
Unknown command "3000". Press F1 for help.
Unknown command "PÅ". Press F1 for help.
nil
So it works to insert, then it ends (after the third ""). Then is handles 0.8 as a command, as you can see.
If you want to insert a certain block on a specific location each time you open a drawing you should use something like this I'd say:
(defun c:rev ( / )
(command "_.insert" "ESYMB_30" "0,0" "" "" "")
(princ)
)
From there on you might want to update a attribute that is in the specific block.
Others might have a handy routine to help you out, I myself cannot write that down for you in a minute: I will have to spend lots of time searching.
Good luck.
msasu
11th Nov 2009, 12:29 pm
@Tom_Drawer: Please make sure that the ATTREQ system variable is set to 1 - this ensure that the INSERT command will accept atributes input at command line.
Regards,
Tom_Drawer
13th Nov 2009, 12:48 pm
Thanks, msasu!
I will check that when i am at the office, i dont have access to the computer right now.
/Tom
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.