BTW, the Entity type should have string-type properties corresponding to
most ObjectId-type properties, so in the case of simply setting/getting
values, you can use the string property instead of the ObjectId property.
For example, the Entity's Layer property returns the name of the layer,
while the LayerId property returns the layer's ObjectId.
See the attached pic. It shows some properties of an entity, and you can
see that for each property whose name ends with 'Id', there is a
corresponding property that returns the name of the object as a string. For
example, the Linetype property returns the name of the referenced Linetype,
and the Material property returns the name of the referenced material.
If you are not persisting references to things like layers and only need to
get/set values using string names, you can use the string equivalents..
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010
http://www.acadxtabs.com
Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");
wrote in message news:6243758@discussion.autodesk.com...
Thanks Tony. Is there a method built in to get and set values of those
properties that cannot be cast to a string? Like Points, TextStyles, Dims,
etc. Its a lazy question, but honestly I don't mind writing my own methods
to treat these, I just dont want to be reinventing the wheel.
What I'm working on is an audit/rules application (not sure why autocad
don't built it in). Right now its all spaghetti code with rules hardcoded,
all in vba. Now that I'm redoing all of it to .net I am building it so the
admin can put the rules in the DB and then when an audit is performed, a
matrix of rules (properties with values) is built and cab be run against the
drawings. Then give an option to the user to fix the issues.
That's why i'm looking to build it without hardcoding as much as possible.
It'd be nice to pass the name of a style to the style property and have it
accept it and all those other things. As of right now the only way I see it
is if I add a method for each of the objects, so that I can pull out the
values I want and set the values I want.