Inserting blocks and cancelling help!! :)

Discussion in 'AutoCAD' started by BOBQ, Sep 25, 2004.

  1. BOBQ

    BOBQ Guest

    The following code worked in autocad 2000, but not now in 2004.
    The idea was to insert the main drawing bomblock and cancel the command
    before actually inserting
    the entire drawing, this allowed the block definitions to insert which could
    then be used.

    now in 2004 it passes a *cancel* to future commands?? It does it after
    doing an audit and
    finding a duplicate block definition.

    (If (= (tblsearch "block" "atitle") nil)
    (command "insert" (strcat rcm_bom "bomblock.dwg") "0,0" (command))
    );end if

    even just entering the following at the command line creates an error....

    Command: (command "insert" (strcat rcm_bom "bomblock.dwg") "0,0" "1" "1"
    "0")

    result:
    Command: (command "insert" (strcat rcm_bom "bomblock.dwg") "0,0" "1" "1"
    "0")
    Auditing Mechanical Data...
    Number of errors found: 0 Number of errors fixed: 0
    Auditing Mechanical Data complete.
    Value must be nonzero.
    errorFunction cancelled; error: An error has occurred inside the *error*
    functionAutoCAD variable setting rejected: "plinetype" 0
    Enter Y scale factor <use X scale factor>:
    Requires numeric value.
    Enter Y scale factor <use X scale factor>: *Cancel*



    manually entering the command shows something different at the command line,
    the "Duplicate definition of block GENAXEH ignored."
    shown below does not show up above, it is almost as if this output is being
    passed to the insert
    command???


    Enter block name or [?]: bomblock.dwg
    Auditing Mechanical Data...
    Number of errors found: 0 Number of errors fixed: 0
    Auditing Mechanical Data complete.
    Duplicate definition of block GENAXEH ignored.
    Specify insertion point: 0,0
    Specify insertion point or [Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
    Enter X scale factor, specify opposite corner, or [Corner/XYZ] <1>:
    Enter Y scale factor <use X scale factor>: 1
    Specify rotation angle <0>: 0
     
    BOBQ, Sep 25, 2004
    #1
  2. BOBQ

    Kelie Guest

    What about using
    (COMMAND "-INSERT" BlkPath "0,0" "" "" ^c^c)?
     
    Kelie, Sep 25, 2004
    #2
  3. (or
    (tblsearch "block" "bomblock")
    (progn
    (command "insert" (strcat rcm_bom "bomblock.dwg"))
    (command)
    )
    )


    --

    Marc'Antonio Alessi
    http://xoomer.virgilio.it/alessi
    (strcat "NOT a " (substr (ver) 8 4) " guru.")

    --
     
    Marc'Antonio Alessi, Sep 25, 2004
    #3
  4. BOBQ

    BOBQ Guest

    Still doesn't work, it seems to have something to do with this:

    "Duplicate definition of block GENAXEH ignored." but I am not sure...

    Thanks for your help.
     
    BOBQ, Sep 25, 2004
    #4
  5. BOBQ

    Kelie Guest

    "Duplicate definition of block GENAXEH ignored."
    means the definition of block "GENAXEH" already exists in the drawing.
     
    Kelie, Sep 25, 2004
    #5
  6. the error is inside theese lines:

    Value must be nonzero.
    errorFunction cancelled; error: An error has occurred inside the *error*
    functionAutoCAD variable setting rejected: "plinetype" 0

    Try to cut and paste only this on command line:

    (setq rcm_bom "put_your_path_here")
    (or
    (tblsearch "block" "bomblock")
    (progn
    (command "_.insert" (strcat rcm_bom "bomblock.dwg"))
    (command)
    )
    )

    or post all the code.


    Cheers.

    Marco
     
    Marc'Antonio Alessi, Sep 26, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.