马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- [LispFunction("MoveStretchpoint")]
- public static ResultBuffer moveStretchpoint(ResultBuffer rb)
- {
- ResultBuffer resultBuffer = new ResultBuffer();
- Document document = Application.DocumentManager.MdiActiveDocument;
- Editor editor = document.Editor;
- Transaction transaction = document.TransactionManager.StartTransaction();
- IntegerCollection integerCollection = new IntegerCollection(1);
- using (transaction)
- try
- {
- if (rb != null )
- {
- TypedValue[] rbArr = rb.AsArray();
- TypedValue entId = rbArr[0];
- if (rbArr.Length > 2 && entId.TypeCode == (int) LispDataType.ObjectId)
- {
- Point3d acPt3d = new Point3d();
- foreach (TypedValue arg in rbArr )
- {
- switch (arg.TypeCode)
- {
- case 5009:
- acPt3d = (Point3d)arg.Value;
- break;
- case 5003:
- short i = (short)arg.Value;
- int n = i;
- integerCollection.Add(n);
- break;
- default :
- //editor.WriteMessage(arg.TypeCode.ToString());
- break;
- }
- }
- if (integerCollection.Count != 0 )
- {
- ObjectId id = (ObjectId)entId.Value;
- Entity entity = (Entity)transaction.GetObject(id, OpenMode.ForWrite,false);
- Vector3d vector3D = acPt3d.GetVectorTo(new Point3d(0, 0, 0));
- entity.MoveStretchPointsAt(integerCollection, vector3D);
- }
- }
- }
- transaction.Commit();
- return null;
- }
- catch (Exception)
- {
- throw;
- }
- }
(movestretchpoint entity vec index1 index2 ...) |