Click or drag to resize

ComponentBaseGetOrCreateBoltGroup(String, PartBase, PartBase, Vec3, Vec3) Method

返回用户文档首页
获取或创建螺栓组

Namespace: LoongCAD.STC.Object3D
Assembly: LoongSDKSTC (in LoongSDKSTC.dll) Version: 2024.0.9.3 (2024.0.9.3)
Syntax
C#
BoltGroup GetOrCreateBoltGroup(
	string usage,
	PartBase main,
	PartBase sub,
	Vec3 posStart,
	Vec3 posEnd
)

Parameters

usage  String
对象用途key,用于下一次执行时索引复用
main  PartBase
主零件
sub  PartBase
次零件
posStart  Vec3
起始控制点
posEnd  Vec3
结束控制点

Return Value

BoltGroup
螺栓组对象
Remarks
创建螺栓组对象之后,需要首先设置WorkAxis属性、然后再设置其他属性
Example
C#
var boltGroup = compInst.GetOrCreateBoltGroup("main_bolt", mainPart, subPart, posStart, posEnd);
boltGroup.WorkAsix = woxkAxisW; // 应首先复制螺栓的工作坐标系
boltGroup.RotationSide = Define.ObjectSide.SIDE_TOP
boltGroup.BoltStandard = boltStandard;
boltGroup.BoltSize = boltSize;
boltGroup.Shape = Define.BoltGroupShape.BOLT_GROUPSHAPE_ARRAY;
boltGroup.ArrayStrideX = new double[] {100.0};
boltGroup.ArrayStrideY = new double[] {100.0};
boltGroup.HoleTol = holeTol;
boltGroup.SectionFlags = sectFlags;
boltGroup.MadeType = Define.PartMadeType.PART_MADE_SITE;
boltGroup.ThreadInMtrl = false;
boltGroup.HoleType = Define.BoltHoleType.BOLT_HOLE_OVERSIZED;
boltGroup.HoleX = 0.0;
boltGroup.HoleY = 0.0;
boltGroup.RotateSlot = Define.BoltRotateSlot.BOLT_SLOT_PARALLEL;
boltGroup.CutLength = 2.0 * (mainThickness + subThickness);
boltGroup.Refresh(); // 设置完所有属性之后需要手动刷新螺栓对象以使得属性生效
See Also