Set schematic root

824
5
01-02-2014 09:16 PM
ArishKhan
New Contributor II
Hi,

I'm trying to set schematic root of a schematic diagram after generating it through ISchematicBuilder.GenerateDiagram method.


            ISchematicDiagram GeneratedDiagram = schBuilder.GenerateDiagram(DiagramName, schemDiagramContainer, propertySet1, (ISchematicBuilderContext)schBuilderCtxt, null);
          
            IPropertySet propertySet = GeneratedDiagram.PropertySet;
            propertySet.SetProperty("FLAG_ROOT", "16-4-0"); // Some hard-coded value of the schematic root
                    
            GeneratedDiagram.AlterPropertySet(propertySet);
            GeneratedDiagram.Store();

After performing the above, i can see that the diagram has stored the properties but i cannot see the difference in the layout of the diagram. Do i need to re-execute the layout algorithm and if so how can i do that through my code.

By the way, i tried to re-execute the layout algorithm through ArcMap after generating the diagram and setting the schematic root but it made no difference to its layout.

Any help will be appreciated.
Thanks
Arish
Tags (2)
0 Kudos
5 Replies
RickAnderson
Occasional Contributor III
Although I haven't tried this specific case, it looks like you are setting the root at the wrong level and with an incorrect value.  You need to set it at the feature/element level and it is either (null, emptry or 0), or a -1.  -1 means it is a Root.

See this entry for more info
0 Kudos
Vara_PrasadM_S
Occasional Contributor II

Hi Arish Khan /  Rick Anderson ,

Could you please let me know the way to set the Schematic Root and Schematic End Element through ArcObjects. I did not find any documentation about that. I tried the way that you explained in your initial post but it did not work.

Thanks in advance!

With Regards,

Vara Prasad

0 Kudos
ChinhMai-Trung
New Contributor II

Hi Vara Prasad M S 

This is a sample code in 10.x to set an End Node through ArcObjects

ISchematicInMemoryFeatureNode ipIMFeatureNode = xxx;

ISchematicInMemoryFeatureNodeFlags inMemoryFeatureNodeFlags = ipIMFeatureNode as ISchematicInMemoryFeatureNodeFlags;

inMemoryFeatureNodeFlags.EndNode = true;

And a documentation for ISchematicInMemoryFeatureNodeFlags

http://resourcesdev.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/ISchematicInMemoryFe...

Vara_PrasadM_S
Occasional Contributor II

Thanks a lot Chinh Mai-Trung‌!

I will try and let you know.  Thanks again for your great help. The link you provided is broken. I am referring this.

http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#ISchematicInMemoryFeatureNodeFlags.h... 

With Regards,

Vara Prasad

0 Kudos
Vara_PrasadM_S
Occasional Contributor II

Hi Chinh Mai-Trung,

Thanks a lot for your help. It worked well and could apply Layout.

With Regards,

Vara Prasad