Jump to content

File name and date in title block


lulu

Recommended Posts

Hi,

I've been searching through the forums and my manuals for a way to automatically add the current filename and date to my title block, to no avail. I find it hard to believe that folks enter that information manually. Am I missing something?

lulu

Link to comment

Hi Lulu and others,

I made a little command that does exactly this, you can use it from a scriptpalette, but you can also make a menu command, paste the code you find below and place this command in your workspace. make sure to also assign it the P for the keyshortcut and place the standard Print command in some obscure menu so you won't accidentally use that. You may not leave it out of the workspace, as my command will search for it there. (I have a '~' command for this very purpose)

To use it, you place some textblocks in your drawing and assign them these classes: 'P-PRINTDATUM' and 'P-PRINTTIME' (without quotes). Then double click the script, or choose your Menucommand from the menu and ready you are.

You may want to delete the three lines that have to do with printing "Black and White only".

When you use this command, it looks like the text is inserted after the print command, but it is actually inserted before and will be used in the print.

For inserting Filename and Path please check out this site:

http://www.orangedust.co.uk/filepath.html

Have fun with it,

Gerard jonker

-----------copy below this line--------------

procedure afdrukken;

{****************************}

{* Copyrights Jonker en Wu *}

{* ir G.D.Jonker *}

{****************************}

var

whatclas,tekst:string;

aanuit:boolean;

function Fplacedate(hd:handle):boolean;

begin

if gettype(HD) = 10 then {= text}

begin

whatclas:=getclass(HD);

if (whatclas ='P-PRINTDATUM') then begin

tekst := Date(0,0);

if tekst = '' then tekst := ' ';

{Not to throw away the text block, insert some spaces}

settext(hd,tekst);

end;

if whatclas = 'P-PRINTTIME' then begin

tekst := Date(2,2);

if tekst = '' then tekst := ' ';

{Not to throw away the text block, insert some spaces}

settext(hd,tekst);

end;

end;

End; {Fplacedate}

begin{afdrukken}

aanuit := Getpref(10); {register how you found B&W}

setpref(10,true); {turn on B&W}

ForEachObjectInLayer (Fplacedate,0,2,2) ;

Redrawall;

Domenutextbyname('Print',0);

setpref(10,aanuit); {Reset to found B&W state}

end; {afdrukken}

run(afdrukken);

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...