button routine

Discussion in 'AutoCAD' started by ffejgreb, Aug 26, 2003.

  1. ffejgreb

    ffejgreb Guest

    I know I've seen this type of thing asked before, but I can't find it. What
    I would like to do is this (in a toolbar button):

    Check to see if an xref is loaded, if not, load it, if so, reload it.

    Any help would be, well, helpful.

    Thanks much in advance,

    Jeff
     
    ffejgreb, Aug 26, 2003
    #1
  2. ffejgreb

    Rudy Tovar Guest

    Here's a jump start.-Example

    (defun c:titleblock (/ blk name)

    (setq blk (ssget "x" '((0 . "insert")(2 . "*XBD*"))))

    (if blk
    (setq name (ssname blk 0)
    name (entget name)
    name (cdr (assoc 2 name))
    name (tblsearch "block" name)
    name (cdr (assoc 70 name))
    )
    )

    (if (= name 36)
    (command "xref" "u" "*xbd*")
    )
    (if (= name 4)
    (command "xref" "r" "*xbd*")
    )
    (princ)
    )
     
    Rudy Tovar, Aug 26, 2003
    #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.