Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Our new ERP system requires a custom iproperty called "gss_rm_qty" for raw material measurement in string format.
I would like our users to be able to choose whether this value is actual face area or bounding box size (basically length x width)... I've already put together the code to create these custom iproperties (SheetMetalExtentsArea vs SheetMetalActualArea below), however, they are "number" type. Which is preventing me from writing the choice directly to "gss_rm_qty" with the error:
Overload resolution failed because no Public '=' can be called with these arguments:
'Public Shared Operator =(a As String, b As String) As Boolean':
Argument matching parameter 'a' cannot convert from '__ComObject' to 'String'.
Below is the part of the code that is not working...
oMyParameter=ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters
'Setting a userParameter as text parameter
Try
otester = oMyParameter.Item("ActualOrEstimated")
Catch
oAreaType = oMyParameter.AddByValue("ActualOrEstimated", "Estimated", UnitsTypeEnum.kTextUnits)
'make parameter a multivalue list parameter
MultiValue.SetList("ActualOrEstimated", "Estimated", "Actual")
End Try
If oMyParameter.Item("ActualOrEstimated") = "Estimated" Then
oCustomProps.Item("gss_rm_qty") = Convert.ToString(oCustomProps.Item("SheetMetalExtentsArea").Value)
Else
oCustomProps.Item("gss_rm_qty") = Convert.ToString(oCustomProps.Item("SheetMetalActualArea").Value)
End If
I tried to use CStr() & Convert.ToString()in but it doesn't seem to work either. Maybe I'm not formatting them correctly, idk.
oCustomProps.Item("gss_rm_qty") = Convert.ToString(oCustomProps.Item("SheetMetalActualArea").Value)
oCustomProps.Item("gss_rm_qty") = CStr(oCustomProps.Item("SheetMetalActualArea").Value)
Any help to get this formatted correctly to output would be appreciated. Thanks!
Solved! Go to Solution.