Skip to content

How to create a simple point? #616

Answered by danmarshall
radar4ick asked this question in Q&A
Discussion options

You must be logged in to vote

Maker.js ought to have a better way of handling DXF entities. Until then, you might be able to inject into the entities section. Here is example DXF for a drawing with only a circle:

0
SECTION
2
HEADER
9
$INSUNITS
70
4
0
ENDSEC
0
SECTION
2
TABLES
0
TABLE
2
LTYPE
0
LTYPE
72
65
70
64
2
CONTINUOUS
3
______
73
0
40
0
0
ENDTAB
0
TABLE
2
LAYER
0
ENDTAB
0
ENDSEC
0
SECTION
2
ENTITIES
0
CIRCLE
8
0
10
0
20
0
40
50
0
ENDSEC
0
EOF

I believe you can add your points before the end of the final section. I haven't tried this, but here's a function written by ChatGPT:

function injectPoint(dxfData, pointData) {
  // Find the index of the last line of the ENTITIES section before it ends
  const endEntities…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by radar4ick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants