Jump to content

Paulo Renan Ferrari

Member
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by Paulo Renan Ferrari

  1. Hi Everyone, I Have a worksheet in Vectorworks, with the CMYK values and, the code/nome of product. I need to convert this in .xml, like this below: <D>0.000000,0.117647,0.156863,0.419608</D> <N>SW 0001&#160; - Mulberry Silk</N> I trying made this with this Script below: But I have problem with separation after 0 (.), My export script doesn't put dot (.), Decimal point, after 0. MY EXPORT PLUG IN: 000000,3584070,6858410,113725 R129Abóbora I WANT IT TO BE LIKE THIS: 0.000000,0.3584070,0.6858410,0.113725 R129Abóbora PROCEDURE ExportTXTCMYK; VAR fileName : STRING; hplan : HANDLE; vcode, vnome, vcyan, vmangen, vyellow, vblack : STRING; numRows, numColumns : INTEGER; vlin : INTEGER; vboo: BOOLEAN; BEGIN fileName := 'Suvinil_CMYK.txt'; Append(fileName); hplan := GetObject('Teste2l'); IF (hplan <> NIL) THEN GetWSRowColumnCount(hplan, numRows, numColumns); vlin := 2; REPEAT vcode := GetCellStr(hplan, vlin, 1); vnome := GetCellStr(hplan, vlin, 2); vcyan := GetCellStr(hplan, vlin, 7); vmangen := GetCellStr(hplan, vlin, 8); vyellow := GetCellStr(hplan, vlin, 9); vblack := GetCellStr(hplan, vlin, 10); WriteLn(vcyan,vmangen,vyellow,vblack,vcode,vnome); WriteLn; {WriteLn('Teste Teste');} vlin := vlin+1; UNTIL(vlin>numRows); vboo := EOF('Teste_CMYK.txt'); Close('Teste_CMYK.txt'); END; RUN (ExportTXTCMYK); Sherwin-Williams Colors.xml
  2. Paulo Renan Ferrari

    Extract Worksheet (Column) Values

    Hi, I'm creating a script that convert RGB to CMYK, the Calc it's OK. But, I need to know, how can I extract the information (Values in numbers) contained in worksheet cell (R, G, B Column) to put in VAR (r,g,b) and after the calc process, paste the result of Cstr, Mstr, Ystr and Kstr in other Worksheet Cell Like (C, M, Y, K Column). The worksheet name is: CMYK, PROCEDURE RGBToCMYK; { ------------------------------------------------------ } CONST { ONLY TO TEST} r = 127; g = 255; b = 212; { ------------------------------------------------------ } VAR c, m, y, k : REAL; {r, g, b : LONGINT} Cstr, Mstr, Ystr, Kstr : STRING; BEGIN c := 1 - ( r / 255 ); m := 1 - ( g / 255 ); y := 1 - ( b / 255 ); k := 1; IF ( c < k ) THEN k := c; IF ( m < k ) THEN k := m; IF ( y < k ) THEN k := y; c := ( c - k ) / ( 1 - k ); m := ( m - k ) / ( 1 - k ); y := ( y - k ) / ( 1 - k ); Cstr := NUM2STR(4, c); Mstr := NUM2STR(4, m); Ystr := NUM2STR(4, y); Kstr := NUM2STR(4, k); MESSAGE(CONCAT(Cstr, ' ', Mstr, ' ', Ystr, ' ', Kstr)); END; RUN(RGBToCMYK);
  3. Paulo Renan Ferrari

    Extract Worksheet (Column) Values

    Hi Pat, How Are you? Thanks, I appreciate your help. Before I reading your message, I did it that way below: PROCEDURE RGBToCMYK; { ------------------------------------------------------ } {CONST {TESTE} {r = 127; g = 255; b = 212;} { ------------------------------------------------------ } VAR c, m, y, k : REAL; vred, vgreen, vblue : LONGINT; Cstr, Mstr, Ystr, Kstr : STRING; hplan : HANDLE; numRows, numColumns : INTEGER; vlin : INTEGER; BEGIN hplan := GetObject('_Plan_Teste); IF (hplan <> NIL) THEN GetWSRowColumnCount(hplan, numRows, numColumns); vlin := 2; REPEAT vred := Str2Num(GetCellStr(hplan, vlin, 4)); vgreen := Str2Num(GetCellStr(hplan, vlin, 5)); vblue := Str2Num(GetCellStr(hplan, vlin, 6)); c := 1 - ( vred / 255 ); m := 1 - ( vgreen / 255 ); y := 1 - ( vblue / 255 ); k := 1; IF ( c < k ) THEN k := c; IF ( m < k ) THEN k := m; IF ( y < k ) THEN k := y; c := ( c - k ) / ( 1 - k ); m := ( m - k ) / ( 1 - k ); y := ( y - k ) / ( 1 - k ); Cstr := NUM2STR(4, c); Mstr := NUM2STR(4, m); Ystr := NUM2STR(4, y); Kstr := NUM2STR(4, k); LoadCell(vlin, 7, Cstr); LoadCell(vlin, 8, Mstr); LoadCell(vlin, 9, Ystr); LoadCell(vlin, 10, Kstr); vlin := vlin+1; message('Linha:', vlin); UNTIL(vlin>numRows); END; RUN(RGBToCMYK); Any comments in this code?

 

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.

×