马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- [LispFunction("SetpropertiesFrom")]
- public void mSetPropertiesFrom(ResultBuffer rb)
- {
- if (rb != null)
- {
- Document document = Application.DocumentManager.MdiActiveDocument;
- Transaction transaction = document.TransactionManager.StartTransaction();
- TypedValue[] values = rb.AsArray();
- using (transaction)
- {
- try
- {
- if (values.Count() == 2 && values[0].TypeCode == (int)LispDataType.ObjectId &&
- values[1].TypeCode == (int)LispDataType.ObjectId)
- {
- ObjectId ids = (ObjectId)values[0].Value;
- ObjectId idt = (ObjectId)values[1].Value;
- Entity sourcEntity = (Entity)ids.GetObject(OpenMode.ForWrite);
- Entity targeEntity = (Entity)idt.GetObject(OpenMode.ForRead);
- sourcEntity.SetPropertiesFrom(targeEntity);
- }
- transaction.Commit();
- }
- catch (Exception)
- {
- throw;
- return;
- }
- }
- }
- }
|