API Rumination
API Rumination
(OP)
Folks,
Somewhat of a philosophical question.
Since Custom Property names are case sensitive regarding capture via VB &
VBA does anyone have a nice clean way of "looking past" the case of a
property to grab the value regardless of how it was defined originally
(example: Cost, cost, COST,etc). var1 =
ModelDoc.GetCustomInfoValue(ConfigName, "COST") would miss the prop Cost.
I have a method I use but feel its somewhat clunky (read slow). The
philosophical part of this is that if one used a software tool to define the
custom props at part creation they would all be uniform case and the problem
is solved, but alas we all know there are always exceptions!
Thoughts.... ruminations?
Somewhat of a philosophical question.
Since Custom Property names are case sensitive regarding capture via VB &
VBA does anyone have a nice clean way of "looking past" the case of a
property to grab the value regardless of how it was defined originally
(example: Cost, cost, COST,etc). var1 =
ModelDoc.GetCustomInfoValue(ConfigName, "COST") would miss the prop Cost.
I have a method I use but feel its somewhat clunky (read slow). The
philosophical part of this is that if one used a software tool to define the
custom props at part creation they would all be uniform case and the problem
is solved, but alas we all know there are always exceptions!
Thoughts.... ruminations?
Guy Edkins
Managing Partner
Delta Group Ltd
gedkins@deltagl.com
www.deltagl.com






RE: API Rumination
RE: API Rumination
You can have a "material" property, OR a "MaTeRiAl" property, but NOT a "material" AND a "MaTeRiAl" property.
So this is no different than any other text validation:
force the case of the text on both the needed, and the stored property, and see if they are an exact match.
RE: API Rumination
var1 = ModelDoc.GetCustomInfoValue(ConfigName, "DESCRIPTION")
var1 = ModelDoc.GetCustomInfoValue(ConfigName, "Description")
Guy Edkins
Managing Partner
Delta Group Ltd
gedkins@deltagl.com
www.deltagl.com
RE: API Rumination
I entered a value for "Description", and clicked the "Modify" button to save it.
I then Started typing "DESC", clicked the mouse on the value box, entered a value, and watched the "Modify" button change to an "ADD" button. I then tried tricking it, and mouse-clicked back on the "Name" field, and finished typing in "ription" .. by the time i hit the "n", I watched the "ADD" button change to a "Modify" button.
RE: API Rumination
Guy Edkins
Managing Partner
Delta Group Ltd
gedkins@deltagl.com
www.deltagl.com
RE: API Rumination
StrConv
LCase
UCase
You could probably write a subroutine to compare string values (i.e. chack to see if values of two stringsare the same when both are forced lowercase)
RE: API Rumination
To further expand on TheTick's idea, you could write a routine that loads all of the custom properties and their values into an array, then deletes all the custom properties from the document and finally resaves the custom properties but using the LCase, UCase, etc functions to modify their names to whatever designation you desire.
Regg