在创建profile的过程中,我尝试获取Profile的Alignment属性,但是发现该属性为空。
在没有创建profile的时候,profile的Alignment属性都是正常有值的。
请问如何在创建Profile的过程中,获取到profile对应的Alignment对象?
麻烦把你这块的代码发给我看下。
List<Profile> profiles = new List<Profile>(); DgnModel activeModel = Session.Instance.GetActiveDgnModel(); ConsensusConnection con = new ConsensusConnection(activeModel); foreach (Element e in activeModel.GetGraphicElements()) { Profile p = Profile.CreateFromElement(con, e) as Profile; if (p != null && p.IsFinalElement) profiles.Add(p); }
在启动用ORD自带的创建Profile工具过程中,如:Profile Complex By PI,上述代码获取到的Profile的Alignment属性为null,而在未启动创建Profile工具的时候,获取到的Profile的Alignment属性不为null
这是我用你的代码测了下,是可以获取Alignment的在使用Profile Complex By PI工具时候。
请你再检查一下是否地形模型激活,切面是否激活等。