SolidWorks Doc props: from API?
SolidWorks Doc props: from API?
(OP)
This one *seems* easy enough: there are properties available
to link to drawings and models, even when 'manually' making parts, that are not listed in the standard File Properties tabs of "Summary", "Custom", or "Configuration Specific", but are available in a design table as properties, such
as "$PARTNUMBER" and "$PARENT".
Anyone know of a way to access these variables thru the API,
if a Design Table is not present?
to link to drawings and models, even when 'manually' making parts, that are not listed in the standard File Properties tabs of "Summary", "Custom", or "Configuration Specific", but are available in a design table as properties, such
as "$PARTNUMBER" and "$PARENT".
Anyone know of a way to access these variables thru the API,
if a Design Table is not present?






RE: SolidWorks Doc props: from API?
and Configuration::AlternateName
As for $PARENT, I am not familar with that. If you could give an example, it may wake up my brain.
Regg
RE: SolidWorks Doc props: from API?
http://www.nhcad.com/old/html/example7.html
Example 7 - config props.swb
'****************************************************************
'
' Config Props.swb
' Joe Jones
' New Hampshire CAD www.nhcad.com
' 03/09/98
'
' Will write several custom properties to active configuration
' ***************************************************************
Dim swApp As Object
Dim Part As Object
Dim Configuration As Object
Dim ConfigName As String
Dim retval As Boolean
Sub main()
Set swApp = CreateObject ("SldWorks.Application")
Set Part = swApp.ActiveDoc
Set configuration = Part.GetActiveConfiguration
ConfigName = configuration.Name
' retval is True or False upon successful AddCustomInfo3 function
retval = Part.DeleteCustomInfo2 (ConfigName, "drawnby")
retval = Part.AddCustomInfo3 (ConfigName, "drawnby", _
30, "Joe Jones")
' will insert todays date
retval = Part.DeleteCustomInfo2 (ConfigName, "Date")
retval = Part.AddCustomInfo3 (ConfigName, "Date", 64, Str(Date))
retval = Part.DeleteCustomInfo2 (ConfigName, "LuckyNumber")
retval = Part.AddCustomInfo3 (ConfigName, "LuckyNumber", _
3, 345.99)
retval = Part.DeleteCustomInfo2 (ConfigName, "Success")
retval = Part.AddCustomInfo3 (ConfigName, "Success", 11, "Yes")
End Sub
Bradley