I have code that creates new variables in a SE draft document and want to get a reference to the 'copy link' path to automatically create links in Excel but haven't found a way to do it programatically.
Link should look something like this based on cache folder path:
Tried using Solid Edge Spy but I think the right click menu is accessing a method outside of 'Variable' interface to get the reference path.
'Create SE Variable
Set objVar = objVars.Add(pName:="Swing", pFormula:="30", UnitsType:=igUnitScalar)
'Paste link into Excel to new SE variable
myWbk.WorkSheets("DB_Links").Range("Swing").value = objVar.???? <- how to get link ?
Solved! Go to Solution.
It seems that there is no API exposed for copying the variable link, at least I can't find it...
seems you simply need the pathname of your draft document and the name of the Solid Edge variable (omitting the leading V) you want to link to from Excel and then build up a formula as the following sample (linking to a variable named V652):
This formula expression you simply assign to the desired cell in your Excel sheet.
The solution from Wolfgang seems to work, but I was almost sure that the SystemName of a variable did NOT correspond to the variable number in the link in the past....
Wolfgang - This is the way I was headed but was hoping for a direct call to make the code more robust in the event SE changes the link format in the future.
Martin - Thanks for taking a look as well. That was my conclusion too.
i just tested the Solid Edge method
This works, if you paste then within Excel the value via the option to link. Doing so the Excel cell gets filled with a formula as already discussed above
is there a line code or something that lets one part gets a variable value from another part without using excel ?
i can do it in excel no problem
we have a standard items folder and when i do it with excel and use revision manager to create a new assembly for a new client it copies the excel file with it
then if we make an adjustment to the standard part the part in the client folder does not update
i want it to do it automatically without using excel PLEASE
With a document open, you can try opening another document silently and access the variables collection there in. This will give access to the desired variable whose value can be used in the current part.
i have found a way but you have to use excel
when you control a part with excel and want the control of excel but all assemblies where that standard part is used to work then when want to copy the file dont copy / paste
use revision manager BUT if you want all the parts to use that excel file for dimensioning purposes DESELECT / CLEAR ACTION on the excel file
when you do that where ever you REVISION MANAGER copy that file to
it will data link to the excel file
be careful because if an adjustment is made on a dimension it will affect ALL of the parts that is controlled by the spreadsheet
i hope this can help someone in the futur