Here's another one for you

Discussion in 'AutoCAD' started by Roderic Potter, Jan 23, 2004.

  1. Take a look at this code:

    (COMMAND "insert" blank PAUSE 1.0 "" 0)

    Here I use the insert command to specify a point for block insertion, and
    pause for user click on-screen.

    I cannot use other methods like "getpoint" because I want the predefined
    block "blank" to appear at the cross-hairs when I choose the insertion
    point. I re-use the same insertion point after this in later code by using
    the "@" symbol (corresponding to the last point picked).

    I want to be able to capture the point picked so I can pass this to a
    variable such as "pt1". I have not been able to use the "@" symbol to
    achieve this.

    The reason I want to capture the point picked is so that I can add code to
    evaluate what layer an entity is on, residing at that point, automatically.

    Any ideas?
     
    Roderic Potter, Jan 23, 2004
    #1
  2. Look at lastpoint system variable.
    --
    Ken Alexander
    Acad2004
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein
     
    Ken Alexander, Jan 23, 2004
    #2
  3. Roderic Potter

    David Bethel Guest

    (COMMAND "insert" blank PAUSE 1.0 "" 0)
    (cdr (assoc 10 (entget (entlast))))

    Should also work.

    Look out for non WCS points

    -David
     
    David Bethel, Jan 23, 2004
    #3
  4. Returned salute.
    --
    Ken Alexander
    Acad2004
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein
     
    Ken Alexander, Jan 23, 2004
    #4
  5. Roderic Potter

    Warren Trost Guest

    Also, do you need a hyphen before INSERT? "-insert"
     
    Warren Trost, Jan 23, 2004
    #5
  6. Roderic Potter

    Thomas Smith Guest

    Within a macro or script you would need the hyphen, but not when calling it
    from the command function.
     
    Thomas Smith, Jan 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.