Edit Client Graphics of a Client Feature

Edit Client Graphics of a Client Feature

Anonymous
Not applicable
808 Views
6 Replies
Message 1 of 7

Edit Client Graphics of a Client Feature

Anonymous
Not applicable

I'm trying to save some custom geometry using client graphics in a client feature.  However, I can't find a way to edit this geometry should I need it to change.

 

I'm trying to translate the points belonging to a SurfaceGraphics object.  I'm not getting an exception, but the points seem unaffected.  If I check the point value after my call to "TranslateBy" for example, the point value remains unchanged.

 

Is this point data supposed to be read-only once it is attached to  a SurfaceGraphics object, or ClientFeature?  Otherwise, can you let me know how to go about changing the geometry of a SurfaceGraphics object without recreating it entirely.

 

Thanks in advance.

0 Likes
Accepted solutions (1)
809 Views
6 Replies
Replies (6)
Message 2 of 7

sanjay.ramaswamy
Alumni
Alumni

A SurfaceGraphics object is created using a body as input. Do you want to transform the location of the entire body? Or do you want to modify the body itself? If it's the former, use the GraphicsNode.Transformation property. If it's the latter, you'll need to delete and recreate the SurfaceGraphics with a new body.

0 Likes
Message 3 of 7

Anonymous
Not applicable

I wanted to modify the body itself.

 

If you can think of a better way to store client graphics in a way that I can edit the vertices directly, please let me know.

 

I was hoping to have a real-time update of the body while the add-in is being used, but recreating the entire surface would probably be too slow.  Are there any other forms of non-persistent client graphics that would allow me to modify vertex coordinates directly?  I could create a temporary copy and use that for editing and display only, then save it back to the client feature when done, if such a mechanism existed.

 

Thanks for your help.

0 Likes
Message 4 of 7

sanjay.ramaswamy
Alumni
Alumni

You'd have to create the client graphics body using triangle primitives (i.e. facets), instead of the body input. See the programming help for a sample that creates a cylinder based on triangle graphics (sample is named "Client Graphics - Triangle"). You can then edit the graphics data sets to modify the "body" and the client graphics will update.  

0 Likes
Message 5 of 7

Anonymous
Not applicable

I've tried that, but the data does not seem to persist.  Is triangle data attached to client feature client graphics supposed to be saved?

 

 

0 Likes
Message 6 of 7

sanjay.ramaswamy
Alumni
Alumni

In order to create persistent graphics data, you need to use the GraphicsDataSetsCollection.Add2 method and set the SaveWithDocument argument in the method to True.

0 Likes
Message 7 of 7

Anonymous
Not applicable
Accepted solution

Thanks for your help, that worked.

0 Likes