Entmake nested block problem

Discussion in 'AutoCAD' started by liftedaxis, Mar 10, 2005.

  1. liftedaxis

    liftedaxis Guest

    I first encounted this issue with R2000, and now that I need it resolved, I see it still doesn't work with 2004.

    I need to Entmake a Block, that will itself be comprised of two blocks. One of the blocks is scaled times dimscale, the other is scaled at either 1.0 or at a fixed scale. Yet no matter what I put for the group 41/42 scale factors, they are always created at 1.0. Code is like so:

    (entmake (list (cons 0 "BLOCK") (cons 2 blockx) (list 10 0.0 0.0 0.0) (cons 70 0)))
    (entmake (list (cons 0 "INSERT") (cons 2 blk1) (append (list 10) pt1) (cons 41 scale1) (cons 42 scale1) (cons 43 0.0))
    ; in above line, "scale1" can be a million, or 0, no difference
    (entmake (list (cons 0 "INSERT") (cons 2 blk2) (list 10 0.0 0.0 0.0) (cons 41 iRadius) (cons 42 iRadius) (cons 43 0.0) (cons 50 rotate1)) )
    ; again, in above line, "iRadius" is ignored by acad
    (setq blockx (entmake '((0 . "ENDBLK")) ) )

    What are my options at this point? I was thinking I could just recreate the sub-blocks entities within the new block, but I'd have to figure out how to scale them correctly, which sounds like an incredible pain. The current code just inserts the blocks, and uses (command "BLOCK") to create the master block, but I need to change this to make it an anonymous block, hence the need to use entmake.

    Much thanks for any tips and help.

    --Jeremiah
     
    liftedaxis, Mar 10, 2005
    #1
  2. liftedaxis

    Jeff Mishler Guest

    Use ActiveX methods.......just tried yours vs ActiveX. You already know what
    yours does, the ActiveX acted as desired.....

    (setq blk (vlax-invoke
    (vla-get-blocks
    (vla-get-activedocument
    (vlax-get-acad-object)))
    'add
    '(0.0 0.0 0.0) blockx))
    (vlax-invoke blk 'insertblock pt1 blk1 scale1 scale1 scale1 rotation1)
    (vlax-invoke blk 'insertblock pt1 blk2 iradius iradius iradius rotation1)
     
    Jeff Mishler, Mar 10, 2005
    #2
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.