Changing the Field of Property Array.

Changing the Field of Property Array.

Anonymous
Not applicable
419 Views
4 Replies
Message 1 of 5

Changing the Field of Property Array.

Anonymous
Not applicable
Hi,
I have a c++ wrapper which contains an array^ property. When i access it via PropertyGrid, it is displaying something like below.

DValue Double[] Array
[0] 22
[1] 33
[2] 44

But, i want the appearance to be like this.

DValue 22,33,44
A 22
B 33
C 44

I can achieve the Starting part (i.e.)

DValue 22,33,44

with the help of TypeConverter in c#.

But i cannot be able to change the remaining part as above.

Could anyone kindly solve my problem?

Thank you in Advance.

Regards,
Vignesh. S
0 Likes
420 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Your mistake is using double[] to represent 3D coordinates.

That's a very bad design. Arrays are generic which makes it difficult to treat those used to represent 3d coordinates in a special way as you are trying to do.

Instead of using arrays, use Point3d, and provide a TypeConverter for it.

See this file for examples:

http://www.caddzone.com/ComponentModel.cs

Add the file to a C# project, NETLOAD it, and run the sample command. You will see a property grid that shows 2D and 3D coordinates and vectors the way you want.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5840303@discussion.autodesk.com...
Hi,
I have a c++ wrapper which contains an array^ property. When i access it via PropertyGrid, it is displaying something like below.

DValue Double[] Array
[0] 22
[1] 33
[2] 44

But, i want the appearance to be like this.

DValue 22,33,44
A 22
B 33
C 44

I can achieve the Starting part (i.e.)

DValue 22,33,44

with the help of TypeConverter in c#.

But i cannot be able to change the remaining part as above.

Could anyone kindly solve my problem?

Thank you in Advance.

Regards,
Vignesh. S
0 Likes
Message 3 of 5

Anonymous
Not applicable
It is not 3d Coordinates. They are Length values for Different Lines.
0 Likes
Message 4 of 5

Anonymous
Not applicable
Hi Tony,
I actually put A, B, C for not confusing anyone by the X, Y, Z coordinates. But i didnt know that it will misguide you.

Anyhow, I found the Solution for my problem.

It is just by overriding the PropertyDescriptor's DisplayName Property.

Thank you for your Reply.
0 Likes
Message 5 of 5

Anonymous
Not applicable
Regardless of what the values represent, the methods shown
in the example still apply to what you need to do. You can
implement a TypeConverter and apply it to properties of an
object that returns a double[] to present it the same way the
sample code presents 3D points.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5841288@discussion.autodesk.com...
It is not 3d Coordinates. They are Length values for Different Lines.
0 Likes