Purpose
DWF version 5.0 introduced the Group opcode, used by both AutoCAD and Inventor, to tag geometry as belonging to an object hierarchy. The group names can be used to provide enhanced features for object display and selection. Additionally, the group names are used to link the groups to metadata in an external XML file produced with the DWF file during publishing.
The primary drawback in the Group opcode in that it is too bulky. It was designed to fit into the existing format without causing any compatibility problems. With WHIP! 6.0, the opportunity to make this a single-byte opcode was taken.
To prevent future complications, the WHIP! 6.0 specification deprecates the Group opcodes.
The authoring tools (AutoCAD and Inventor) will be responsible for keeping selection information and metadata associated with object nodes in an external file, by referring to the object nodes indicated in the WHIP! data. The specification and/or schema for such selection and metadata is considered domain-specific and is thus outside the scope of this document.
A new single-byte ID opcode has been added to facilitate the referencing of objects. Since the Object Node opcode is expected to be rather ubiquitous, several different space-saving opcode choices are available:
Opcode format |
Opcode [ASCII] (Hex) |
Operand Format |
Comments |
Extended ASCII |
(Node |
<ws><INodeNum>[<ws><TNodeName>]) |
ASCII readable integer, optional string
name |
Single-byte, binary operand |
[N]
(4E) |
<ULNodeNum> |
32-bit unsigned integer (absolute value) |
Single-byte, binary operand |
[n] (6E) |
<SNodeNum> |
16-bit signed relative offset |
Single-byte, binary operand |
[Ctrl-N] (0E) |
|
Auto increment +1 from previous node value |
NodeNum The node number which will be assigned to the geometric primitives that are subsequently created. A NodeNum of zero indicates that no node attribute will be applied to subsequent primitives (until the next node is encountered, of course). In ASCII form, the highest node number allowed is 4294967295.
NodeName An optional ASCII text string that names the node number specified.
Details
Opcodes in a .dwf file can be assigned to a specific node, which is a grouping of opcodes that can later be referenced from external metadata. For example, in a mechanical drawing, a node can be used to specify multiple primitives belonging to a particular part.
To put it plainly, the node attribute is essentially another layering mechanism (albeit without visibility control).
A node attribute is attached to a specific set of opcodes by surrounding them with a pair of Node opcodes: the first with a NodeNum (and optionally a NodeName) specified and the second with a zero NodeNum:
(Node 1 ‘Door‘) | The node will be attached to subsequent geometry. |
L 10,10 35,35 | This line is attached to node 1, the Door node. |
L 0,10 30,30 | This line is attached to node 1, the Door node. |
(Node 0) | Subsequent geometry will not be attached to a node. |
L 40,40 75,75 | This line is not be attached to a node. |
Notes
A geometric primitive has a maximum of one node attached to it. Also, primitaves in nodes may reside on different layers.
Nodes do not affect the drawing order of geometric primitives. It is possible to have two nodes where some primitives of the first node are drawn before some primitives of the second node and vice versa. To accomplish this, return to a given node after specifying contents for another node. For example, three lines are drawn in the order in which they appear in the file:
(Node 1 ‘Door‘) | The node will be attached to subsequent geometry. |
L 10,10 35,35 | This line is attached to node 1, the Door node. |
(Node 2 ‘Window‘) | Subsequent geometry uses node 2. |
L 0,20 20,20 | This line is on node 2, the Window node. |
(Node 1) | Return to node 1. |
L 20,10 45,35 | This line is attached to node 1, the Door node. |