carpenter1234 Posted October 18, 2009 Share Posted October 18, 2009 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 Quote Link to comment
ccroft Posted October 18, 2009 Share Posted October 18, 2009 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. Quote Link to comment
carpenter1234 Posted October 19, 2009 Author Share Posted October 19, 2009 thanks! works great! Quote Link to comment
Kool Aid Posted October 19, 2009 Share Posted October 19, 2009 A much easier and more productive way would be to set up a class with graphic attributes that are ?Used at creation?. Quote Link to comment
ccroft Posted October 21, 2009 Share Posted October 21, 2009 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! Quote Link to comment
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.