Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lisp to open attribute dialog box

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
JonathanRodrigues
1043 Views, 5 Replies

Lisp to open attribute dialog box

Hi, I am creating a template for the consulting agency I work for and there are various title blocks with effectively the same information in each as attributes, but organized into different size layouts and orientations (e.g. "11x17" and "24x36 Vertical"). I am wondering 2 things:

 

1. If there someone knows of a simple lisp that allows me to open the same attribute dialog box that launches when you insert the block. It can work via selection set or any other manner simple enough to the user.

 

2. If there is a way to have these attributes as common across all block definitions (i.e. for title blocks using attributes such as "date", "dwg title" etc.) and therefore only require one instance of user input into the attribute dialog box which then distributes the set info across the block definitions, and henceforth, the layouts.

 

Help is sincerely needed as I am a novice when it comes to autolisp (I only have experience in C++ and html).

 

Thank you!

5 REPLIES 5
Message 2 of 6
stevor
in reply to: JonathanRodrigues

One way is to make BLOCKs of each title block,

and use the same 'tag' names for each matching attibute.

And attend to the details of the attributes for their characteristics,

such as on https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/AutoC...

 

and for the size that the text will use in the image.

S
Message 3 of 6

My title blocks are already BLOCKs and they have been inserted already into the company .dwt in respective layout tabs.

@stevor I wasn't aware that having the same tag name of attributes connected them in terms of their definition.

My issue is that it want to know the surviving command with which I can bring up the attribute dialogue box to easily fill out the values for the title BLOCK since they're already inserted into the template and therefore won't prompt me when I load a new drawing.
Message 4 of 6
hmsilva
in reply to: JonathanRodrigues

As a starting point,

 

(defun c:demo (/ ss)
    (if (and (princ "\nSelect a title block: ")
             (setq ss (ssget "_+.:E:S:L" '((0 . "INSERT") (66 . 1))))
        )
        (progn
            (initdia)
            (command "_.attedit" (ssname ss 0))
            (while (> (getvar 'cmdactive) 0)
                (command "\\")
            )
        )
    )
    (princ)
)

 

Hope this helps,
Henrique

EESignature

Message 5 of 6

@hmsilva does this mean that "_.attedit" is the specific command to bring up the attribute dialog box where the user input is listed next to the prompt?
Message 6 of 6
hmsilva
in reply to: JonathanRodrigues


@JonathanRodrigues wrote:
@hmsilva does this mean that "_.attedit" is the specific command to bring up the attribute dialog box where the user input is listed next to the prompt?

Jonathan,

the command 'attedit' will bring up the attribute dialog box, but if in a code, we call the command without call the 'initdia' function first, the code will call the command line version...

 

Hope this helps,
Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost