Jump to content
Sign in to follow this  
carpenter1234

set color and fill mode via vectorscript

Recommended Posts

hi,

i am looking for a way to set color and fill mode of an object via vectorscript.

i want e.g. se?ect a rectangle, press a shortcut and get a filled rectangle in cloro grey.

i tried with that script which i recorded with the "multitool" (multiwerkzeug in german translation) but it doesn't work:

Procedure CustTool;

VAR

Name:STRING;

Result:BOOLEAN;

BEGIN

PushAttrs;

PenFore(257);

PenBack(256);

PenPat(2);

FillFore(257);

FillBack(1236);

FillPat(1);

PenSize(2);

PenPat(2);

Result:= SetDefaultBeginningMarker(0, 15, 0.125000, 0.000000, 0, 0.000000, FALSE);

Result:= SetDefaultEndMarker(0, 15, 0.125000, 0.000000, 0, 0.000000, FALSE);

CallTool(-203);

PopAttrs;

END;

Run(CustTool);

any help greatly appreciated

greg

Share this post


Link to post

What you have there is a script that calls the rectangle tool, allowing you to draw one with a set fill color already applied.

For what you want to do you need something more like:

Procedure Filler;

FUNCTION fillObj(h:HANDLE) :BOOLEAN;

Begin

????SetFPat(h,1);

????SetFillBack(h,50000,50000,50000);

End;

BEGIN

????ForEachObjectInLayer(FillObj,2,0,4);

END;

RUN(Filler);

This will fill selected objects on editable layers with a med/light grey. You'll find that this grey is not on the color palette cause I just put in randomly selected RGB values.

Should get you started.

Share this post


Link to post

A much easier and more productive way would be to set up a class with graphic attributes that are ?Used at creation?.

Share this post


Link to post
A much easier and more productive way would be to set up a class with graphic attributes that are ?Used at creation?.

I agreegiously agree!

Share this post


Link to post

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.

Sign in to follow this  

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...