Assembly Modeling
'----------------------------------------------------------------------------------------------------- 'Create a collection to hold the joints Dim JointCollection As New Collection Dim JointFactory As New HgrJointFactory Dim AssemblyJoint As Object ' pipe length is changed along given axis Set AssemblyJoint = JointFactory.MakePrismaticJoint(HGR_PIPE, "BeginCap", HGR_PIPE, "EndCap", 3565) ' NOTICE 3565''' JointCollection.Add AssemblyJoint ' create logical connection to route with revolute joint Set AssemblyJoint = JointFactory.MakeRevoluteJoint(CONNECTION, "Connection", -1, "Route", 17) JointCollection.Add AssemblyJoint ' connect pipe to logical connection Set AssemblyJoint = JointFactory.MakeRigidJoint(HGR_PIPE, "BeginCap", CONNECTION, "Connection", 9444) JointCollection.Add AssemblyJoint ' create vertical joint. it force pipe length is changed along global z axis Set AssemblyJoint = JointFactory.MakeVerticalJoint(HGR_PIPE, "EndCap", 3) JointCollection.Add AssemblyJoint ' connect end of pipe to structure(platform) Dim dPlaneAngle As Double dPlaneAngle = my_IJHgrInputConfigHlpr.GetPortOrientAngle(ORIENT_DIRECT, "Route", HGRPORT_Z, "Structure", HGRPORT_Z) If dPlaneAngle < PI / 4 Or dPlaneAngle > 3 * PI / 4 Then Set AssemblyJoint = JointFactory.MakePointOnJoint(HGR_PIPE, "EndCap", -1, "Structure", 4) Else Set AssemblyJoint = JointFactory.MakePointOnJoint(HGR_PIPE, "EndCap", -1, "Structure", 5) End If JointCollection.Add AssemblyJoint ' connect foundation to end of pipe with angular joint. so foundation can be rotated with angle given by user Dim varTemp As Variant, sValue As String Dim dAngle As Double my_IJHgrInputConfigHlpr.GetAttributeValue "Member_Angle", Nothing, varTemp sValue = varTemp dAngle = Val(sValue) ' Value is in radian Set AssemblyJoint = JointFactory.MakeAngularRigidJoint(FOUNDATION, "StartOther", HGR_PIPE, "EndCap", 0, 0, 0, CRad(0), CRad(0), dAngle) JointCollection.Add AssemblyJoint ' connect baseplate to foundation Set AssemblyJoint = JointFactory.MakeRigidJoint(BASEPLATE, "StartOther", FOUNDATION, "EndOther") JointCollection.Add AssemblyJoint ' up to here '-----------------------------------------------------------------------------------------------------
댓글
댓글 쓰기