RMorse Posted January 8, 2008 Share Posted January 8, 2008 I'm trying to alter a VW script "setcolorweight" and can't figure out what the numerical colors are. The color table is of no help as it doesn't seem to correspond with the archiac (?) 5x numerical system. What looks like "medium gray" it calls "9" and yet is referred to as 41120,41120,42148 in the script. I understand that the "convert color" script which is a part of v12.5 is supposed to enable us to figure out what the 5x colors are. Unfortunately I get an error message (Line #1: MCVS) when trying to run that. In fact I get that error message when trying to run all the VS I've tried in the plug-ins folder. Strange? I also tried making a new script the editor using script a guy sent to me but no-go. It won't run. Same error. I've checked out the "VW Function Reference" that says that it "lists all procedures and functions available in the VectorScript language".... but doesn't seem to have a line-weight-color one. So I'm really confused. I thought people could make their own scripts? So that's a dead end too. I don't know what to do. I should also mention that I've never written a script and know nothing about coding language. Suggestions? -- Rich -- Quote Link to comment
Pat Stanford Posted January 8, 2008 Share Posted January 8, 2008 What exactly are you trying to do with this script? Here are three short scripts that might get you started. To run each script, copy the lines between the {**************} and paste them into a new VectorScript Editor Window. The first one returns the line weight and the Red/Green/Blue colors of the first selected object on the active layer. You can manually set one object to your preferences, then use the output of this script to know what values to enter into the other scripts. {**************} Procedure GetObjectPenInfo; Var R1,G1,B1 : LongInt; LW : Integer; Begin LW:=GetLW(FSActLayer); GetPenFore(FSActLayer,R1,G1,B1); Message('Line weight is: ',LW,' and colors are: ',R1,' ',G1,' ',B1); End; Run(GetObjectPenInfo); {**************} The second script changes the pen weight and color of the first selected object on the active layer to the values manually set in the script. Since it does not use any variables, it does not need to be called a Procedure or have a Begin/End or a Run statement. Change the 20 to the line weight (in mils) that you want, and set the 0,0,65535 to the values you get from the first script for the color you want. {**************} SetLW(FSActLayer,20); {Change this value to the mils of line weight you want} SetPenFore(FSActLayer,0,0,65535); {Change these values to the color values you want} RedrawAll; {**************} The third script sets that document default pen color and weight to the values manually set in the script. Set the colors and line weight the same way you do in the second script. {**************} PenFore(0,0,65535); PenSize(20); RedrawAll; {**************} Let me know if you have additional questions. Sincerely, Pat Quote Link to comment
RMorse Posted January 9, 2008 Author Share Posted January 9, 2008 What exactly are you trying to do with this script?I want to make anything I have selected change color and lineweight by a hot-key command. I typically use only 4 (rarely to 6) lineweights and like lines in those weights be depicted in different colors so that I can instantly see how they'd print out. One of my drafters made scripts that did just that (about 10 years ago) which has worked flawlessly until v12.5. Here are three short scripts that might get you started.Great! Unfortunately they don't work. I get the same error message: Line #1: MCVS Getting the first two scripts to work should do it for me. I really don't understand what the third one is for? -- Rich -- 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.