Even if the core DXF library is limited, it can be a good idea to look at its source, to see how it "captures" calls to drawing primitives. Also look at PApplet, defining all these primitives, actually forwarding them to the PGraphics named g: it also calls the primitives on the current recorder, if there is one. This one can be PDF, DXF, or other.