Paulo Renan Ferrari Posted August 14, 2018 Share Posted August 14, 2018 (edited) 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  - 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 Edited August 14, 2018 by Paulo Renan Ferrari Quote Link to comment
Pat Stanford Posted August 14, 2018 Share Posted August 14, 2018 I think this is due to your system language settings using the comma as the decimal separator. Probably the most straight forward way to solve this is to convert to strings using the format you want and then writing the strings to the file. That way you will have full control over the output. Num2Str should get you a string value, but it will probably still have the comma as the decimal separator. Loop through using something like the following: ChangePos:=Pos(',',MyStringVariable); Delete(MyStringVariable,ChangePos,1); Insert(MyStringVariable,Changepos,'.'); HTH. 1 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.