nullオブジェクトは選択されたオブジェクトのローカル座標と同じ座標へ配置されます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | try { var oRoot = ActiveProject.ActiveScene.Root; var oObj = Selection(0); var oNull = oRoot.AddNull(oObj.Name + "_null" ); var oObjLcl = oObj.Kinematics.Local; var x = oObjLcl.Parameters( "posx" ).Value; var y = oObjLcl.Parameters( "posy" ).Value; var z = oObjLcl.Parameters( "posz" ).Value; var oLocalTrans = XSIMath.CreateTransform(); oLocalTrans.SetTranslationFromValues(x, y, z); oNull.Kinematics.Local.Transform = oLocalTrans; CopyPaste(oObj, null , oNull, 1); SelectObj(oNull, null , null ); ToggleVisibility( null , null , null ); SelectObj(oObj, null , null ); } catch (err) { logmessage(err.message); } |
No comments:
Post a Comment