AssemblyProperties Interface

 

Hi all,

In the SE SDK has the "AssemblyProperties" interface.

I want to get something through this interface, but the results is null.

I want to add something to model through AddProperty(String) and AddPropertyItem(String, PropertyTypeConstants, Object)  method, but I can not find the content I added in models.

In models, Where is AssemblyProperties????

my program:

SolidEdgeFramework.Application SEApp = null;

            SolidEdgeFramework.SolidEdgeDocument SEDoc = null;

            SolidEdgeAssembly.AssemblyDocument ASMDoc = null;

            SolidEdgeAssembly.AssemblyProperties asm_props = null;

            SolidEdgeAssembly.AssemblyProperty asm_prop = null;

            SEApp = Marshal.GetActiveObject("SolidEdge.Application") as SolidEdgeFramework.Application;

            SEDoc = SEApp.ActiveDocument as SolidEdgeFramework.SolidEdgeDocument;

            if (SEDoc.Type == SolidEdgeFramework.DocumentTypeConstants.igAssemblyDocument)

            {

                ASMDoc = SEDoc as SolidEdgeAssembly.AssemblyDocument;

                asm_props = ASMDoc.AssemblyProperties;

******************get ************************************but is null

                for (int i = 1; i

                {

                    asm_prop = asm_props.Item(i);

                    MessageBox.Show(asm_prop.Name);

                }

**********************************************************

*****************add************************************but I can not find in model

                asm_props.AddProperty("hello asm");

                asm_prop = asm_props.Item(1);

                asm_prop.AddPropertyItem("111", SolidEdgePart.PropertyTypeConstants.sePropertyTypeString,(object)("hell"));

            }

Please help!

Thanks!

 

Posted by: fat kids
Post date: 7/20/2010 4:23:24 PM

2 REPLIES

RE: AssemblyProperties Interface

 

This worked for me on ST2.using System;using System.Reflection;using System.Runtime.InteropServices;namespace SETest{ class Program { static void Main(string[] args) { SolidEdgeFramework.Application application = (SolidEdgeFramework.Application)Marshal.GetActiveObject("SolidEdge.Application"); SolidEdgeAssembly.AssemblyDocument assemblyDocument = (SolidEdgeAssembly.AssemblyDocument)application.ActiveDocument; SolidEdgeAssembly.AssemblyProperties assemblyProperties = assemblyDocument.AssemblyProperties; SolidEdgeAssembly.AssemblyProperty assemblyProperty = assemblyProperties.AddProperty("My Property"); assemblyProperty.AddPropertyItem("My Item", SolidEdgePart.PropertyTypeConstants.sePropertyTypeString, "My Item Value"); object value = assemblyProperty.GetItemValue("My Item"); } }}

 

Posted by: Jason Newell
Post date: 7/21/2010 2:22:29 PM

RE: AssemblyProperties Interface

Thanks jason!

Can I find this assemblyProperty in the SE's interface ?

 

 

Posted by: fat kids
Post date: 7/21/2010 5:32:32 PM