马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
初学娱乐而已
 - [LispFunction("SwapID")]
- public void swipId(ResultBuffer rb)
- {
- if (rb != null)
- {
- TypedValue[] tvArr = rb.AsArray();
- Document document = Application.DocumentManager.MdiActiveDocument;
- Database database = document.Database;
- using (Transaction transaction = document.TransactionManager.StartTransaction())
- {
- try
- {
- if (tvArr.Length == 2 && tvArr[0].TypeCode == (int)LispDataType.ObjectId &&
- tvArr[1].TypeCode == (int)LispDataType.ObjectId)
- {
- DBObject dbObject =
- (DBObject) transaction.GetObject((ObjectId) tvArr[0].Value, OpenMode.ForWrite);
- dbObject .SwapIdWith( (ObjectId )tvArr [1].Value ,true,true );
- }
- transaction.Commit();
- }
- catch (Exception)
- {
- throw;
- }
- }
-
- }
- }
(swapid (car (entsel)) (car (entsel)))
|