public static void openProfile(string unparsed) { DgnModel dgnModel = Session.Instance.GetActiveDgnModel(); long myid = 1231; ElementId elId = new ElementId(ref myid); Element ele = dgnModel.GetDgnModel() .FindElementById(elId); if (ele != null) { ConsensusConnectionEdit con = ConsensusConnectionEdit.GetActive(); AlignmentEdit al = (Alignment.CreateFromElement(con, ele)) as AlignmentEdit; DPoint3d[] points = { new DPoint3d(100, 100), new DPoint3d(600, 110), new DPoint3d(1000, 105) }; ProfileElement element = ProfileElement.Create1(450.0, 750.0, points); if (element != null) { con.StartTransientMode(); ProfileEdit edit = ProfileEdit.CreateByProfileElement(con, al, element, true, false); con.PersistTransients(); al.SetActiveProfile(edit); } } }
问题是ord中还未加载启动程序,ord就崩溃了
您的代码看着没问题,调试需要选择托管managed。
您需要看看,到底是调试的时候崩溃,还是调试正常,加载您的dlk就崩溃了,如果能调试进入您的代码,那么估计是代码有问题,如果都没进去您的代码就崩溃了,那就不好说了。
还未加载dll程序,只是在VS2015里调试启动ord软件就崩溃了,后续再次打开ORD就坏了
csAddins_createPrefile_ord.zip