PDA

View Full Version : Redefine block script


tuomo.jarvinen
2005-01-11, 09:47 AM
Hi,

I tried to redefine a block via script like this:

-insert "c:/store/2d/hinaaja.dwg" 0,0,0 1 1 1 erase (entlast)

but the existing block "hinaaja" doesn't change. If I insert the block by insert-command and browse to "c:/store/2d/hinaaja.dwg" the block is redefined.

The idea is to update a bunch of blocks by running one script.

What is going wrong/ is it possible to do this with script?

CADmium
2005-01-11, 10:55 AM
try this
_-insert hinaaja="c:/store/2d/hinaaja.dwg" 0,0,0 1 1 1 erase (entlast)

tuomo.jarvinen
2005-01-11, 11:06 AM
Worked without quotation marks:

_-insert hinaaja=c:/store/2d/hinaaja.dwg 0,0,0 1 1 1 erase (entlast)

Gorgeus! Very Much Thank You!

kennet.sjoberg
2005-01-11, 02:09 PM
You do not really have to insert and then erase...

(command "._insert" "hinaaja=c:/store/2d/hinaaja.dwg " nil )
will also do it for You.

: ) Happy Computing !

kennet

tuomo.jarvinen
2005-01-11, 05:19 PM
Thanks, Kennet!

I do sometimes 3d-modelling with AutoCad and it's a real advantage to be able to change big blocks to smaller ones and vice versa before final rendering. This far I used to use xrefs and redir the paths wiht express-tools. Next I'll try to figure out how to "lisp" the process, so that blocks would be redefined to other density without manually writing a script.