Scale before insert of block

Discussion in 'AutoCAD' started by Geir Andersen, Oct 26, 2003.

  1. Is it possible to insert block and see the correct scale before i pick
    insert point?

    This dosent work..
    (command "insert" blk.dwg pause 50 50 pause)

    It scales after i pick the insertion point..
     
    Geir Andersen, Oct 26, 2003
    #1
  2. Geir Andersen

    Tom Berger Guest

    You can move and/or scale it immediately after you inserted it. It
    would be helpful if you told us why you need this function.

    Tom Berger
     
    Tom Berger, Oct 26, 2003
    #2
  3. I have some blocks which is inserted at diffrent scales, typical is 1/50,
    1/100, 1/1
    i have a routine which reads dimscale

    When the dimscale is 50 the block is inserted at scale 50
    The blocks is created at 1/1

    I have a button for each block which i have the code
    ^c^cdrawscl ^c^c(command "-insert" "blck.dwg" pause scale scale pause)

    drawscl.lsp reads the dimscale and returns the scale
     
    Geir Andersen, Oct 26, 2003
    #3
  4. Geir Andersen

    Tom Berger Guest

    (getvar "dimscale") does the job as well, and so you may use this
    insert function:

    (command "._insert" blockname pause (getvar "dimscale") "" pause)

    Tom Berger
     
    Tom Berger, Oct 26, 2003
    #4
  5. I have dimscale = 50
    But when i insert the block it has a scale 1 until i have placed it in its
    position, i would like to see the block with scale 50 before i place it..
     
    Geir Andersen, Oct 26, 2003
    #5
  6. Geir Andersen

    Tom Berger Guest

    I already gave you the solution: move the block after you inserted it.

    (progn
    (command "._insert" blockname '(0 0 0) (getvar "dimscale") "" pause)
    (command "._move" (entlast) "" '(0 0 0) pause)
    )

    Tom Berger
     
    Tom Berger, Oct 26, 2003
    #6
  7. Thank you both..

    =---
     
    Geir Andersen, Oct 27, 2003
    #7
  8. (setq scl (getvar "dimscale")) (setq pt (list 0. 0. 0.)) (command "-insert"
    "<blockname>" pt scl "" "" "move" (entlast) "" pt pause)

    This works, but im not able to rotate it in place



    =---
     
    Geir Andersen, Oct 27, 2003
    #8
  9. Geir Andersen

    Tom Berger Guest

    (setq scl (getvar "dimscale")) (setq pt (list 0. 0. 0.)) (command
    "-insert">"<blockname>" pt scl "" "" "move" (entlast) "" pt pause
    "rotate" (entlast) "" "" pause)

    Tom Berger
     
    Tom Berger, Oct 28, 2003
    #9
  10. Geir Andersen

    Geir A Guest

    ^C^C(setq scl (getvar "dimscale")) (setq pt (list 0. 0. 0.)) (command
    "-insert" "<blockname>" pt scl "" "" "move" (entlast) "" pt pause "rotate"
    (entlast) "" <lastpoint> pause)

    Now i just have to select basepoint for rotating...

    Is it possible to store the insertionpoint , like pt2.... Now there is a
    pause there
    (setq pt2 (getpoint pt1)) ???
    I have tried this but no luck..

    Thanks for everything so far :)
     
    Geir A, Oct 28, 2003
    #10
  11. Geir Andersen

    Tom Berger Guest

    use (cdr (assoc 10 (entget (entlast)))) as your basepoint

    Tom Berger
     
    Tom Berger, Oct 28, 2003
    #11
  12. Geir Andersen

    Geir A Guest

    Now its good, thank you :)

     
    Geir A, Oct 28, 2003
    #12
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.