Results 1 to 5 of 5

Thread: Redefine block script

  1. #1
    Member tuomo.jarvinen's Avatar
    Join Date
    2015-09
    Location
    Jyväskylä, Finland
    Posts
    49
    Login to Give a bone
    0

    Default Redefine block script

    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?

  2. #2
    100 Club CADmium's Avatar
    Join Date
    2004-08
    Location
    Eberswalde, Germany, Europe
    Posts
    128
    Login to Give a bone
    0

    Default Re: Redefine block script

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

  3. #3
    Member tuomo.jarvinen's Avatar
    Join Date
    2015-09
    Location
    Jyväskylä, Finland
    Posts
    49
    Login to Give a bone
    0

    Default Re: Redefine block script

    Worked without quotation marks:

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

    Gorgeus! Very Much Thank You!

  4. #4
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Redefine block script

    You do not really have to insert and then erase...
    Code:
    (command "._insert" "hinaaja=c:/store/2d/hinaaja.dwg " nil )
    will also do it for You.

    : ) Happy Computing !

    kennet

  5. #5
    Member tuomo.jarvinen's Avatar
    Join Date
    2015-09
    Location
    Jyväskylä, Finland
    Posts
    49
    Login to Give a bone
    0

    Default Re: Redefine block script

    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.

Similar Threads

  1. Redefine a Block Inserting it with a Script
    By sifuentes in forum AutoCAD General
    Replies: 12
    Last Post: 2016-04-13, 08:48 AM
  2. Replies: 3
    Last Post: 2014-06-30, 06:58 PM
  3. 2012: Block won't redefine
    By jpglisson in forum AutoCAD General
    Replies: 12
    Last Post: 2012-11-27, 11:57 AM
  4. Multiple block insertion with a script to redefine existing blocks?
    By drafterjohn in forum AutoCAD Customization
    Replies: 5
    Last Post: 2009-08-10, 01:52 PM
  5. Redefine Open - automatically run a script upon opening a drawing
    By Mamma Jamma in forum AutoCAD Customization
    Replies: 9
    Last Post: 2005-12-21, 07:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •