Tere
-
Posts
13 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Posts posted by Tere
-
-
Hi everyone, I need to write a script that finds all objects with a specific RGB fill, and for these objects sets a specific pen thickness (like an outline).
Below is my first attempt and attached what it says the errors are. Thanks a lot for helping!
PROCEDURE LWUpdate;
FUNCTION ChangeThickness(h :HANDLE) :BOOLEAN;CONST { substitute these with the required values }
ToLW = 0.35; {mm}
VAR
r, g, b :LONGINT;
VToLW:REAL;BEGIN
GetFillBack(h,r,g,b);
IF (r = 34952) & (g = 34952) & (b = 34952) THEN
SETLW(h, VToLW);
GetFillFore(h,r,g,b);IF (r = 34952) & (g = 34952) & (b = 34952) THEN
SETLW(h, VToLW);
END;
BEGIN{ Each object option here is set to affect all objects, on all layers, using a deep traversal}
VToLW := ToLW / 25.4 * 1000;
ForEachObjectInLayer(ChangeThickness,0,2,1);END;
Run(LWUpdate); -
Hi everyone,
I would like to be able to write scripts that change objects on a given layer/class. I will want to do things like: changing fill or pen colour/thickness or switching a particular layer/class off. Can you please advise me whether there is a good example of a similar script out there that I could have a look at and use as a guideline when adjusting to fit my needs?
Thank you very much!!
-
Just to let you know, I managed to resolve it by adding:
FOREACHOBJECT(ChangeIt, T=POLY);
after this line of the script:
FOREACHOBJECT(ChangeIt, T=2);
...apparently, some of the lines were polygons, now it works fine! Thanks again for helping 🙂
-
Thanks a lot, I will play around and see what I can do!!
-
-
-
-
Thanks! Actually for this particular task, I literally just need all the lines to be set to black colour and to 0.13 mm, do you think you could help me with how to edit the script so that it does that? For future reference, could you also please advise me on how to use a less than/greater than range in the script please? Thanks so much!!
-
Hi everyone, I cannot seem to work out why my lines won't change thinckness. Might I be setting the values in the script wrong?
The attached screenshot shows attributes of an example line I need to change. It's thickness is 0.25, and just to see the change clearly, the new thickness would be 1.
What am I doing wrong please?? The script otherwise compiles.
PROCEDURE LineWeightChange;
{ © Petri Sakkinen 2008 }
CONST { substitute these with the required values }
oldWeight = 0.25;
newWeight = 1;
PROCEDURE ChangeIt (h : HANDLE);
BEGIN
SETLW(h, newWeight);
END;
BEGIN
FOREACHOBJECT(ChangeIt, LW = oldWeight);
END;
RUN(LineWeightChange);
Thanks for helping!
-
Thanks a lot, will try that!
-
Thanks so much, that has now worked!
-
Hi everyone, I would like to start automating some tasks I am performing in VW using Vectorscript but am new to it. The first task I would like to automate is SELECTING ALL OBJECTS OF A CERTAIN FILL FORE COLOUR (rgb values, in this case specifically 255, 255, 204) AND CHANGING THE FILL FORE COLOUR TO DIFFERENT COLOUR (rgb values 187, 209, 96, ideally, but not necessarily also 40% opacity). It is important to perform all at once, since I want to be able to perform multiple such specific colour and line colour/weight changes all at one go.
From studying tutorials and adjusting the script in 'Setting/Changing Object color' thread, this is what I have:
PROCEDURE GreenUpdate;
FUNCTION MakeItGreen(h :HANDLE) :BOOLEAN;VAR
r, g, b :LONGINT;BEGIN
GetFillBack(h,r,g,b);
IF (r = 255) & (g = 255) & (b = 204) THEN
SetFillBack(h,187,206,96);
GetFillFore(h,r,g,b);
IF (r = 255) & (g = 255) & (b = 204) THEN
SetFillFore(h,187,206,96);
END;
BEGIN{ Each object option here is set to affect all objects, on all layers, using a deep traversal}
ForEachObjectInLayer(MakeItGreen,0,2,1);
END;
Run(GreenUpdate);The script compiles but does not do anything! I tried to delete as little from the original as possible not to mess it up..
Thanks so much for helping 🙂
Changing pen thickness to object of a specific colour
in Vectorscript
Posted
Thanks a lot, that now works!!