Lisp Problem - BASE / INSBASE

Discussion in 'AutoCAD' started by mlv, Mar 1, 2007.

  1. mlv

    mlv Guest

    AutoCAD14 (I know, but I like 14 :)

    I have a Lisp routine for quickly modifying 2D blocks that has always worked
    perfectly.... until today, when I was modifying a third party drawing.

    As part of my Lisp routine, a marker line is drawn that originates from the
    defined insert point of the block being modified. The line is there to
    indicate the insert point that was specified when the block was previously
    created.

    When I ran the routine on a block in the third party drawing, the marker
    line was drawn displaced from the defined block insert point.

    I think I have identified the problem as 'INSBASE' (or 'BASE') not being set
    to (0.0 0.0 0.0). In this case it was set to (7.0 8.5 0.0) and that is
    the displacement that had been applied to the originating end of the marker
    line.

    How do I resolve this problem?

    I tried resetting 'INSBASE' to (0.0 0.0 0.0) and then running my Lisp
    routine, but it made no difference (which surprised me) and the marker line
    was still displaced as before.

    With 'INSBASE' still set to (0.0 0.0 0.0) I then exploded and redefined
    the block. I then inserted the (redefined) block and ran my Lisp routine on
    it. The marker line was still displaced as if 'INSBASE' was still set to
    (7.0 8.5 0.0).

    I noticed that the entity code for the block (assoc 10) still gave the
    insert point WITH the 'INSBASE' = (7.0 8.5 0.0) displacement applied, even
    though I had reset 'INSBASE' to (0.0 0.0 0.0).

    Maybe I don't fully understand 'INSBASE'. Is the 'INSBASE' setting also
    stored somewhere else? How can the redefined block entity code (assoc 10)
    still include this displacement, despite the fact that I've reset it to (0.0
    0.0 0.0)? Am I missing something obvious?

    Do I have to somehow apply the 'INSBASE' setting to the entity code (assoc
    10) insert point to remove the displacement and ensure the marker line
    originates correctly from the defined insert point of the block?
     
    mlv, Mar 1, 2007
    #1
  2. mlv

    strawberry Guest

    Did you purge the drawing prior to redefining the block?
     
    strawberry, Mar 2, 2007
    #2
  3. mlv

    per.corell Guest

    Then you proberly need to rewrite that by allowing it first to chack
    that var. and then offsetting everything you use the Lisp rutine for.
    Checking the insert base shuld be easy and if it is wrong it seem
    obvious too allow the offset . I would use an easy Mapcar '+ or - for
    each member of the two lists , It shuld be easy to add a check for if
    plus or minus are to be used .
     
    per.corell, Mar 2, 2007
    #3
  4. mlv

    mlv Guest

    I guess you're right, I have to check the variable "INSBASE" and if it's not
    (0.0 0.0 0.0), use its setting to correct the displacement.

    What I can't get my head round is why the displacement still occurs after I
    have set "INSBASE" to (0.0 0.0 0.0) and redefined the block. Where else
    is the displacement stored?
     
    mlv, Mar 5, 2007
    #4
  5. mlv

    mlv Guest

    No! What would that have achieved?

    I set "INSBASE" to (0.0 0.0 0.0) and then redefined the block using the
    original block name, so all instances of the block should have updated.
    There were no nested blocks to consider.
     
    mlv, Mar 5, 2007
    #5
  6. mlv

    strawberry Guest

    I don't know if it would achieve anything. It's just that, in my
    experience, it's better to purger the drawing prior to recreating
    blocks - especially where attributes are involved.
     
    strawberry, Mar 5, 2007
    #6
  7. mlv

    strawberry Guest

    I don't know if it would achieve anything. It's just that, in my
    experience, it's better to purge the drawing prior to recreating
    blocks - especially where attributes are involved.
     
    strawberry, Mar 5, 2007
    #7
  8. mlv

    mlv Guest

    I now think this a UCS problem and I need to be looking at the TARGET or
    UCSORG settings.

    Any guidance anyone?
     
    mlv, Mar 6, 2007
    #8
  9. mlv

    Mal Guest

    Try (setvar "insbase" (getpoint)) and just show where you want the base
    point to be. That would be tedious if you have a lot of them, so you
    could write a little macro for it. Oh, and you would probably want to
    set it back to 0.0 0.0 0.0 when you are done. Had that problem once - I
    think that's how I got around it.
    Mal
     
    Mal, May 16, 2007
    #9
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.