Header setvariable function
DeepankarGupta13 opened this issue · 4 comments
DeepankarGupta13 commented
initially I was trying to set units to meter by
dxf.header.setVariable('$INSUNITS', 6); // units to meter
but the above code was not working
the below one worked but can we simplify this to the above one. the above one looks better and simple I think.
dxf.header.setVariable('$INSUNITS', { 70: 6 }); // units to meter
tarikjabiri commented
Hi
Actually for setting the units there is a better way.
import { DxfWriter, Units } from '@tarikjabiri/dxf';
const dxf = new DxfWriter();
dxf.setUnits(Units.Meters);
And for the other variables you should define them like the below you mentioned
You can define a helper function that can do that by passing to it your dxf instance and a value if you use it often
DeepankarGupta13 commented
thanks
DeepankarGupta13 commented
this is not in the docs should I add this by creating a new element in nav header?
tarikjabiri commented
As you like, if you have time