FranAJA Posted February 24 Share Posted February 24 (edited) I am trying to make the drawing issue sheet a bit parametric avoiding that one created automatically from vw which are not customizable for our office needs. Cell E29 has value 1, E30 = 2 E31 = 3 Title Block Issue Data-1, Data-2, Data-3 , (basically 3 issues). I am tring to make the number associated to the cell above. =CONCAT('Title Block Issue Data-'; E30; '.'; 'Current Revision') doing ''Title Block Issue Data-'', so with two ' , does not really work. i do not understand how to implement a cell value inside the string of the record call. the character : ' is used both for string and for worksheet record command. Could someone help me please ? Is there any way to fix this ? Edited February 24 by FranAJA Quote Link to comment
Pat Stanford Posted February 24 Share Posted February 24 I hope I am wrong and someone will correct me, but I don't believe there is a way to generate a text string inside a worksheet and have it converted to a formula. This is one of the things that makes working with Revision and Issue records difficult. You could use a Vectortscript/Python Script to read the data from those cells and generate the formula in the desired cell, but I think the user interface would be challenging. I think the best solution would be a worksheet script. Quote Link to comment
FranAJA Posted February 24 Author Share Posted February 24 I was hoping in you Pat. calling then the script by the command =RUNSCRIPT ? I never used this thing do you have a very simple example ? Quote Link to comment
Pat Stanford Posted February 24 Share Posted February 24 Tell me more about what you are trying to do. Are you going to use this in a Worksheet Database of Title Bock objects? If not, how do you expect to determine which Title Block the data is being pulled from? Quote Link to comment
FranAJA Posted February 24 Author Share Posted February 24 (edited) I was trying by script: import vs #Get the ws ws = vs.GetObject('Worksheet-1') #Get the cell value (return None i do not know why, it should return 1 as A1 cell CellValue = vs.GetCellNum(1,1) vs.Message(CellValue) #vs.SetWSCurrentCell(ws,2,6) formula = "="+"'Title Block Issue Data-"+ str(CellValue) + "'.'Current Revision'" vs.SetWSCellFormula(ws,6,2,6,2,formula) I have just tried to write this script and it works, just that does not get the value "1" of the cell probably i am using the wrong command. I am struggling also to use this: I would like to use the Script-1 (that one above) in the resource manager but VW crashes or i am not doing correctly. Edited February 24 by FranAJA Quote Link to comment
FranAJA Posted February 24 Author Share Posted February 24 (edited) import vs ws = vs.GetObject('Worksheet-1') CellValue = int(vs.GetWSCellValue(ws,1,1)) vs.Message(CellValue) #vs.SetWSCurrentCell(ws,2,6) formula = "="+"'Title Block Issue Data-"+ str(CellValue) + "'.'Current Revision'" vs.SetWSCellFormula(ws,6,2,6,2,formula) Edit: I solved using the script above. (getwscell) However still trying to run the script inside the worksheet, my script is in the resource managere but i would like to run the script automatically when i recacultate the ws. Edited February 24 by FranAJA Quote Link to comment
Pat Stanford Posted April 20 Share Posted April 20 Sorry for the very long delay in replying. Your can use a worksheet formula of =RunScript('Your_Scirpt_Name_Here') to cause your script to run every time the worksheet recalculates. But you will have to have a separate script for every worksheet because I have not found a way for a script to determine the name or a handle to the worksheet that is running the script. Put the RunScript in a cell near the top of the worksheet. If you don't want to see it, put it in a row by itself and then set the row height to zero to hide it. HTH 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.