Click or drag to resize

IAttachNodesUtilsParseNodeFromString Method

Creates an attach node form the part's config definition string.

Namespace:  KASAPIv2
Assembly:  KAS-API-v2 (in KAS-API-v2.dll) Version: KAS API v2
Syntax
C#
AttachNode ParseNodeFromString(
	Part ownerPart,
	string def,
	string nodeId
)
Request Example View Source

Parameters

ownerPart
Type: (Default Namespace)Part
The part to parse the node for. The new node will not be added to this part, but the required settings from this part will be used to produce the node (e.g. the rescale factor).
def
Type: SystemString
The string to parse.
nodeId
Type: SystemString
The ID of the new node. Keep it unique in scope of the part.

Return Value

Type: AttachNode
The new node or null if parsing has failed. The created node will not be automatically added to the part.
Remarks

The string format is exactly the same as for the part's attach node definition. It consists of 10 parts, separated by a comma. Only the first 6 parts are mandatory, the others are optional. The format is the following: Position(X,Y,Z), Orientation(X,Y,Z), Size, AttachMethod, CrossFeedAllowed, IsRigid

  • Position is defined by the first 3 float numbers.
  • Orientation is defined by the next 3 float numbers.
  • Size is an integer number starting from 0 (tiny). If the size is omitted, it's assumed to be 1 (small). When coupling two nodes, the minumim size of the two is selected to create the actual joint.
  • AttachMethod is a node attach type, which must be 0.
  • CrossFeedAllowed is 1 when the resources can flow thru this node, and 0 when the flow must be forbidden. Note, that in order to enable the cross feed mode, the oppossing node must be allowing it as well. If ommited, then the value is 1.
  • IsRigid is 0 for the normal part joint, which allows some degree of freedom under a strong force. Value 1 will instruct to create a completely locked joint. If omitted, then the value is 0. Note, the the rigid joint will be created if any of the two coupling nodes require it.

See Also