VL block insertion point.

Discussion in 'AutoCAD' started by BillZ, Aug 6, 2004.

  1. BillZ

    BillZ Guest

    R2005:

    I create a user ucs and add a block definition:

    (setq InsBlk1 (vla-Add (vla-Get-Blocks *acaddoc*)(vlax-3D-Point '(0.0 0.0 0.0)) "Rec_1"))

    #<VLA-OBJECT IAcadBlock2 0da73054>

    I make a point list array from the same points as my UCS and add a polyline to the block and all is well.

    Now, I change to another UCS and insert the block:

    (setq Blk1 (vla-InsertBlock *mspace* (vlax-3D-Point '(0.0 0.0 0.0)) "Rec_1" 1 1 1 0))

    #<VLA-OBJECT IAcadBlockReference 0d629894>

    The block appears, but is at 0,0,0 of the WCS!
    I've tried using different points to add and insert the block but it doesn't seem to chage anything.

    Can someone tell me what to do here?

    TIA

    Bill
     
    BillZ, Aug 6, 2004
    #1
  2. BillZ

    Jeff Mishler Guest

    Bill,
    The insertion point of a block is ALWAYS expressed in terms of WCS. So to
    insert it at 0,0,0 of the UCS you will need to do the transformation matrix
    of the UCS point to WCS coordinates.

    --
    Jeff
    check out www.cadvault.com
    polyline to the block and all is well.
    doesn't seem to chage anything.
     
    Jeff Mishler, Aug 6, 2004
    #2
  3. BillZ

    BillZ Guest

    Don't mention transformation matrixes.

    They have been the source of my pain...

    All I need really is translate from 0. :)


    Bill
     
    BillZ, Aug 6, 2004
    #3
  4. BillZ

    BillZ Guest

    I guess I was wrong. :(

    Do you have to vla-insertbock at 0,0,0 and the transform?

    I thought it would be like the command where you could just place it at a give point?

    Bill
     
    BillZ, Aug 6, 2004
    #4
  5. Translate the point list from UCS to WCS before converting it to a variant
    to pass to the method. (trans) works fine, without messing with a transform
    matrix.

    --
    R. Robert Bell


    I guess I was wrong. :(

    Do you have to vla-insertbock at 0,0,0 and the transform?

    I thought it would be like the command where you could just place it at a
    give point?

    Bill
     
    R. Robert Bell, Aug 6, 2004
    #5
  6. BillZ

    BillZ Guest

    Well, my points (I think) are already in the WCS. The are points from a 3dpolymesh.
    What i was doing was setting a UCS to the points of one section and making my block containing the polyline.
    From what you say, sounds like I should stay in the WCS when I make my block and add the pline?

    Bill
     
    BillZ, Aug 6, 2004
    #6
  7. I'm not talking about the _points_ of the objects within the block. I'm
    talking about the insertion _point_ of the block reference.

    --
    R. Robert Bell


    Well, my points (I think) are already in the WCS. The are points from a
    3dpolymesh.
    What i was doing was setting a UCS to the points of one section and making
    my block containing the polyline.
    From what you say, sounds like I should stay in the WCS when I make my block
    and add the pline?

    Bill
     
    R. Robert Bell, Aug 6, 2004
    #7
  8. BillZ

    BillZ Guest

    Ahhh..

    Thanks


    Bill
     
    BillZ, Aug 6, 2004
    #8
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.