Jump to content

Title block issue data string in worksheet.


Recommended Posts

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.

 

image.png.b00845753d61da9d6f5c7aae89194def.png

 

image.png.91fa3c09d7253eb0a6029e3ecbb30198.png
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 by FranAJA
Link to comment

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.

Link to comment

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.

image.png.9515863c89262176b25306f4e516e394.png


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.

image.png.751f07cd991fa264edeaadd0f9040c41.png

Edited by FranAJA
Link to comment
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 by FranAJA
Link to comment
  • 1 month later...

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

 

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...