View Full Version : Filling in a title block from dialog box input?
aaron.bentley
2008-12-01, 06:29 PM
I'm tring to fill out the title block on six layout tabs at once. I made a dialog box to allow a user to input there information into and I'm not sure on how to get that information to fill in the title blocks. Can Anyone help me solve this as I'm new to lisp programing? Thank you for helping.
Anthony Rhodes
2008-12-01, 08:30 PM
Could you use sheet set manager to do what you are talking about and not have to recreate the wheel? Then you would have a little more power than just filling out the title block. I could be misunderstanding what you want or you may not be able to us SSM. Sorry if that is the case. If you are able to use it I would check it out before continuing on with your lisp routine.
Hi, aaron.bentley
Upload your title block here, please,
to see what are exact tags in this block
and remove the unused info before
Hope I could help
~'J'~
aaron.bentley
2008-12-01, 09:03 PM
Anthony Rhodes, I'm not familiar with sheet set manager so I don't know if that would be easier to do or not?
aaron.bentley
2008-12-01, 09:13 PM
fixo, Here is the title blocks I'm trying to fill in. The Dialog box shows which values I need to stay the same between drawings. Thanks for your help. Aaron
Anthony Rhodes
2008-12-01, 09:21 PM
Aaron,
There is nothing on your title block that SSM could not handle. You will have to rework your title block a little but it is nothing you could not handle since you are cabable of making your own dialog box to do the same thing. I would look it up under help.
Good Luck,
fixo, Here is the title blocks I'm trying to fill in. The Dialog box shows which values I need to stay the same between drawings. Thanks for your help. Aaron
Hi again
Try this one
(defun C:tit (/ dcl_id)
(setq dcl_id (load_dialog "1.dcl"))
(if (not (new_dialog "title" dcl_id))
(exit))
(action_tile "revison" "(setq revno $value)")
(action_tile "Job Number" "(setq jobno $value)")
(action_tile "by" "(setq by $value)")
(action_tile "Date" "(setq dat $value)")
;;; (action_tile "order" "(setq ord $value)");<-- not used in this block
(action_tile "Description" "(setq desc $value)")
(action_tile
"cancel"
"(done_dialog) (setq userclick nil)"
)
(action_tile
"accept"
"(done_dialog)(setq userclick T))"
)
(setq check (start_dialog))
(unload_dialog dcl_id)
(if userclick
(progn
(vl-load-com)
(or adoc
(setq adoc
(vla-get-activedocument
(vlax-get-acad-object)
)
)
)
(vlax-for layout (vla-get-layouts adoc)
(vlax-for obj (vla-get-block layout)
(if (and
(eq "AcDbBlockReference" (vla-get-objectname obj))
(eq "STATUS" (vla-get-name obj)))
(progn
(setq atts (vlax-invoke obj 'GetAttributes))
(foreach at atts
(cond
((eq "REVISION" (strcat (vla-get-tagstring at)))
(vla-put-textstring at revno))
((eq "JOB_NUMBER1" (strcat (vla-get-tagstring at)))
(vla-put-textstring at jobno))
((eq "DRAFTER1" (strcat (vla-get-tagstring at)))
(vla-put-textstring at by))
((eq "DATE2" (strcat (vla-get-tagstring at)))
(vla-put-textstring at dat))
((eq "DESCRIPTION1" (strcat (vla-get-tagstring at)))
(vla-put-textstring at desc))
(T nil)))))))))
(vla-regen adoc acallviewports)
(princ)
)
~'J'~
aaron.bentley
2008-12-01, 09:54 PM
Anthony,
Thank you....I will learn something new today!!
fixo,
It worked great! How would you add in the JOB_NAME and ORDER_NUMBER since they are in a different block and keep it in one command?
Add JOB_NAME and ORDER_NUMBER in the cond statement
as in my code and add tem both in the action_tile
statement accordingly
Follow the code above
If you can't I should do it just tomorrow
~'J'~
ccowgill
2008-12-02, 02:00 PM
As an alternative, from your dialog, you could have it write to the drawing custom properties and then have fields within the title block that read from the drawing custom properties. We dont use sheet manager in our office, probably mostly because when it was first introduced, if the field was part of a text object within the block, it wouldnt update automatically when a change was made. It would only update right away if it was an attribute that contained the field (which increased the chance that someone could erase the field and break the link.) It may have been fixed by now, but because of these short comings, we created a program that uses excel and the custom drawing properties to fill in our title blocks.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.