Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Properties API -"AddCustomInfo3"

Status
Not open for further replies.

CMcF

Mechanical
May 28, 2003
149
I am trying to modify an API that adds custom property data to
parts. I use :-

For m = 0 To 3
retval = Part.AddCustomInfo3("", MyProp(0, m), 30, MyProp(1, m))

Next m

Which works if the custom property did not previously exist. What do I have to do overwrite an existing value?

 
Replies continue below

Recommended for you

Get the existing properties:

strNumber = Part.CustomInfo2("", "Number")

throw this into a form field if you like. Then delete the old property:

retval = Part.DeleteCustomInfo2("", "Number")

The create the property again:

retval = Part.AddCustomInfo3("", "Number", swCustomInfoText, txt_number.Text)

Jason
 
You are correct in the observation that AddCustomInfo3 does not overwrite custom properties.

Usually what I do is write a subroutine to first check for the property, then add or change (using "ModelDoc2::CustomInfo2") as needed. It's also OK to double-up, add first and and then overwrite.

[bat]I could be the world's greatest underachiever, if I could just learn to apply myself.[bat]
-SolidWorks API VB programming help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor