Do you have any Visual Basic programming experience?
if you do, then this can be done by using windows 32 API
Thanks for taking the time to respond. I'm just attempting to learn programming, so it's best to say I don't have any programming experience.
I have a macro I use that sends information to Excel to look to verify that the information is valid then runs a macro in excel to generate a number and returns the value as a custom property in Solidworks. I use the following code to open excel:
xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("File Location")
Set xlSheet = xlBook.Sheets("Sheet Name")
I pass information from the custom properties using:
bool = swCustProp.Get4("Property Name", False, val, valout)
xlSheet.Cells(2, 1).value = val
This is what I use to pass to custom properties:
swCustProp.Add3 "Property Name", swCustomInfoType_e.swCustomInfoText, Property Value, swCustomPropertyAddOption_e.swCustomPropertyOnlyIfNew
swCustProp.Set "Property Name", Property Value
I'm not sure about passing to a global variable, I'm sure it's possible but you'll have to figure that out.
Thanks for your help. From my research so far I know I can put together a macro that browse for excel file and read from it but I just don't have any clue how to link it to global var. or anything else after that. Thanks.
I can think of several reasons why you like the idea of using Excel for this, but there is an out-of-the-box functionality for linking .txt equation files directly to your global variables:
Depending on what you want to accomplish with your global variables (specifically: linking values to captured dimensions from your model), you might find that Design Tables are another good out-of-the-box tool you can use.