Query Primitives
- Last UpdatedApr 27, 2023
- 2 minute read
The primitives with drafting points in common with the current element can be queried by giving the command
Q COMMON
Lists the primitives that are dragged with the current element. The primitives that can be dragged with any named drafting node of a STRAIGHT or an ARC can be queried by
Q node_id COMMON
where node-id is the FPT or TPT of a STRAIGHT or ARC.
The origin and position of a primitive can be queried by
Q ORIG
The offset of a drafting node or primitive origin from the note origin can be set and queried:
Q node_id OFFSET
Q OFFSET
node_id OFFSET X value Y value
ORIGIN OFFSET X value Y value
where node_id is the node of a straight or arc primitive, for example, FPT, TPT, MPT, THPT or CPT. (Refer to the list of DRAG commands for examples of node_id.)
The principal dimensional and positional attributes of a primitive can be listed by using the
Q DESC
command at the primitive concerned (or at the owning View Note (position and angle)).
A drafting point on a STRAIGHT, ARC or span of an OUTLINE can be queried using
Q IDNN @
Allows you to pick one of these points by picking an appropriate position on the primitive. The query reports the appropriate point, the identity of the primitive picked and the position of the picked point. For example:
FPT OF /STRAIGHT3 X 123 Y 456
TPT OF /ARC1 E 3000 N 4000 U 0
VPT /VERT1 NEAR /VERT2 X 495 Y200
In the last case where a span of an OUTLINE was picked, the first vertex identified is the endpoint of the span, and the second is the Vertex (VRTX element) that owns the span. The two Vertex identifiers can be the same.
For STRAIGHTS and ARCS, the point identified is the same as that returned by the Q IDN @ command where the current element is a STRA or ARC. Q IDNN @ allows both the point and the primitive to be picked by one cursor hit.
The database reference ID and the cursor-hit position of any linear element on the Sheet (for example a STRA, side of a RECT or part of Design item) can be queried using:
Q IDLINE @
The query returns the database of the picked element (Draw or Design), the identity of the element, the pair of 2D coordinates that define the linear element, and the 2D position of the cursor hit.
For example, if the query were applied to a STRA element with FPT X100 Y100 and TPT X200 Y200, the return can be:
DRA =151/4636 LINE X 100mm Y 100mm X 200mm Y 200mm
QUAL X 167mm Y 166mm
If the query were applied to a part of a Design element, the return can be:
DES =35/222 LINE X 6.5/16 Y 7.19/32 X 5.3/32 Y 7.19/32
QUAL X 6.1/32 Y 7.19/32