Jump to content

setting text on file opening


J.Fildes

Recommended Posts

Hello all,

I've been wanting to add a little vectorscript of awhile now into some templates I have. I have templates of various sizes and when i create a new drawing I use these templates and have to go through the normal routine of editing the drawing title, editing the date, editing the drawing number, and editing the ECN number. I would love if i could make a script that would pop up a dialog box that would ask for the various pieces upon opening these templates (but i worry that when this drawing gets saved if every time it opens it would do the same process as this would be unnecessary). i have they various pieces of text named "Title", "Date1", "Date2", "Drawing Number" "ECN". These are all text objects. Now as far as scripting goes, i have variables set as dTitle,dNumber, dDate, dECN all as strings. am i correct in assuming that i need a dialog box asking for these variables and then setting each of these variables with settext() to each of my handles? I'm new to this so any help would be appreciated

Link to comment

I don't think it's currently possible to have a script run on file open, though having scripts fire on events such as open, save, print, etc. has been briefly discussed as something worth implementing.

As it stands, I'd probably implement it as a "Document Setup" menu command, similar to the Nemetschek-supplied one under "File > Document Settings > Document Setup..." (though this may be a VW Architect thing, so I'm not sure you'd have it).

On the downside, you have to remember to run it after opening a template. On the upside, it wouldn't run on every save. To make it easier to remember, maybe include a big red note in the template, saying "run this script," that the script will delete on a successful run.

Link to comment

Thanks for the advice, I appreciate it. I'll have to tinker around with it and see what i can come up with. It's probably an easy thing for others to come up with but as it is my first script it's going to take some time but i'm hoping to one day get it working and understand scripts better.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...