Jump to content

Tere

Member
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Tere

  1. 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);
  2. 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!!
  3. 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 🙂
  4. Great, thanks, we are getting there! Here is what the 1st script did - changed some lines but left out others - some seem to be lines and some polylines, so I don't really know what could be happening there?
  5. (btw the second one shows this error page..I am a beginner so resolving errors takes super long and usually does not lead anywhere, but I will get there and pick it up :))
  6. The first one shows this error (please see screenshot) when I try and run it? Also, I would probably want to include polys, rectangles, maybe even circles for the search for this one... Thanks for your help!
  7. 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!!
  8. 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!
  9. 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 🙂
×
×
  • Create New...