dxfjs / writer

A JavaScript dxf generator written in TypeScript.

Home Page:https://dxf.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dimStyle.DIMTXSTY It would be better to provide a reasonable default value.

FishOrBear opened this issue · comments

dimStyle.DIMTXSTY = "16";//Equal to the default Dimstyle handle. Without it, the annotation style will not be correctly displayed.

what do you think

yeah but not sure if it will be convenient for everyone, thus the DIMSTYLE is customizable one can set the values they need.

This is set to standard style handle by default, not sure what is the problem can you provide an example so I can see the problem

dxf.zip

image

image

This is the dxf file I generated. The only difference between them is the default style. When no default inherited style is specified, the dimension text disappears.

Because the dxf we write may not provide all dimstyle values, it would be better to give the default inherited style.

Using the latest version 2.8.1 you do it like this

// Customize the dimStyleStandard
dxf.document.dimStyleStandard.DIMTXT = 16 // The text height
const dim = dxf.addLinearDim(point3d(), point3d(200, 0), {
  offset: 10,
  styleName: dxf.document.dimStyleStandard.name
});

Also you can use the header variables to customize the look of the dimensions

dxf.setVariable('$DIMTXT', { 40: 10 }); // The text height
dxf.setVariable('$DIMASZ', { 40: 10 }); // Dimensioning arrow size