raj banerjee Posted December 19, 2011 Posted December 19, 2011 hello peeps, ive got a block which ads a revision, description of change, drawn by and date to an existing titleblock. The small block has attributes, is there a way to make it so that when its double clicked it oped the ddatte dialog box? my comoputer is set so that when double clicking a block with attributes this happens which is fine, but on some of the other computers in the office it comes up with a different properties dialog box. I was thinking of a button which when clicked envokes the ddatte command for that block, I know how to do it in excel for eg but am just wondering if its possible to do something simialar in cad? any help or advice would great Quote
BlackBox Posted December 19, 2011 Posted December 19, 2011 For fun: (defun c:FOO (/ *error*) (defun *error* (msg) (and oldCmdecho (setvar 'cmdecho oldCmdecho)) (and oldNomutt (setvar 'nomutt oldNomutt)) (cond ((not msg)) ; Normal exit ((member msg '("Function cancelled" "quit / exit abort"))) ; <esc> or (quit) ((princ (strcat "\n** Error: " msg " ** ")))) ; Fatal error, display it (princ)) ((lambda (oldCmdecho oldCtab oldNomutt / ss) (setvar 'cmdecho 0) (setvar 'nomutt 1) (if (and (setq ss (ssget "_x" (list '(0 . "INSERT") '(2 . "[color=red][b]BlockName[/b][/color]") (cons 410 oldCtab)))) (= 1 (sslength ss))) (command "._ddatte" (ssname ss 0)) (cond (ss (*error* "More than one title block found")) ((*error* "Title block not found")))) (*error* nil)) (getvar 'cmdecho) (getvar 'ctab) (getvar 'nomutt))) Quote
dirkvandonkelaar Posted December 19, 2011 Posted December 19, 2011 you can make an custom commmand in the cui and attach the command ddatte as macro, like below. Then you can move it into an toolbar or create a new toolbar for it. When you click on the button, the command ddatte will run. Is this what you're looking for? Quote
BlackBox Posted December 19, 2011 Posted December 19, 2011 Is this what you're looking for? Yes, the OP is after a "button" (be it on a toolbar, menu option, or ribbon we do not yet know?)... But simply adding the DDATTE command as a button is NOT what the OP wants. The OP wants the button to automagically invoke the DDATTE command AND specifically invoke the command on their title block. Hence the code I posted above. Simply set the macro (the code behind the button) to invoke the LISP I posted above, and done. Lemon squeezy. Quote
dirkvandonkelaar Posted December 19, 2011 Posted December 19, 2011 But simply adding the DDATTE command as a button is NOT what the OP wants. I'm sorry.. Quote
BlackBox Posted December 19, 2011 Posted December 19, 2011 I'm sorry.. No need to apologize ; the OP may not know HOW to create the button, in which case you've outlined the necessary steps already. We will need more information from the OP to know for sure... but your post was helpful IMO. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.