Giter Site home page Giter Site logo

style point support about js-dxf HOT 10 CLOSED

clavijojuan avatar clavijojuan commented on July 17, 2024
style point support

from js-dxf.

Comments (10)

ognjen-petrovic avatar ognjen-petrovic commented on July 17, 2024

According to this https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/AutoCAD-Core/files/GUID-82F9BB52-D026-4D6A-ABA6-BF29641F459B-htm.html it is possible
Setting PDMODE and PDSIZE should change point style. I have not tried, will do that latter...

from js-dxf.

clavijojuan avatar clavijojuan commented on July 17, 2024

Okay thanks, I will be pending ๐Ÿ‘

from js-dxf.

tarikjabiri avatar tarikjabiri commented on July 17, 2024

Hi,

You can achieve this by using the header() method, this method it's utility is to add header variables to dxf.

For this purpose there is tow variables in the HEADER section You can define $PDMODE and $PDSIZE.

  • $PDMODE define the shape of the point.
  • $PDSIZE define the size of the point.
const d = new Drawing();

// You can do:
d.header("PDMODE", [[70, value]]); // Where value is your real value.
d.header("PDSIZE", [[40, value]]); // Where value is your real value.

Normally you need to know the variable name and it's utility and add it to dxf with the header() method.
Please see HEADER Section.

  • You can find here all possible values of $PDMODE (Header Variable).
  • For $PDSIZE You can pass a negative value which make the point size relative to the screen, or a positive value makes the point size absolute.

Example:

d.header("PDMODE", [[70, 32]]);
d.header("PDSIZE", [[40, 10]]); // Size absolute.
// Or
d.header("PDSIZE", [[40, -10]]); // Size relative to the screen.

Always set the variable name uppercase and without the $ sign.

@ognjen-petrovic I think this did not need any implementation. Need only explanation.

This apply to all header variables.

Regards

from js-dxf.

clavijojuan avatar clavijojuan commented on July 17, 2024

Hi @tarikjabiri,

I tried your example (following image) :

image

but in the document i got this errors:

image

can you help me please?

from js-dxf.

clavijojuan avatar clavijojuan commented on July 17, 2024

Hi @tarikjabiri,

I tried your example (following image) :

image

but in the document i got this errors:

image

can you help me please?

I modified the values manually and finally can open the file on AUTOCAD, but the file have to be in the following structure

image

do you know where is the error?

from js-dxf.

tarikjabiri avatar tarikjabiri commented on July 17, 2024

Hi,

I am sorry my bad the code should look like this:

d.header("PDMODE", [[70, 32]]);
d.header("PDSIZE", [[40, 10]]); 

Array of arrays

from js-dxf.

clavijojuan avatar clavijojuan commented on July 17, 2024

Hi,
PDMODE fixed but can't open in AUTOCAD
image

from js-dxf.

tarikjabiri avatar tarikjabiri commented on July 17, 2024

Hi,

Is this dxf content generated by js-dxf ?

151024238-c2a02eed-9ebb-4ee2-9426-a194cb4cb2ee

The 9 should be 0.

Did you change it manually ?

The dxf generated work fine.

I tried this example is working fine:

const d = new Drawing();

d.header("PDMODE", [[70, 32]]);
d.header("PDSIZE", [[40, 5]]);

d.drawPoint(0,0);
d.drawPoint(10,10);

Result:

point

The issue is resolved please close this issue

Regards.

from js-dxf.

clavijojuan avatar clavijojuan commented on July 17, 2024

Okay with your code it works, but i have a question :

image

i want the number 3 not 32, so should be the following the code ?

image

Thank you for everything!

from js-dxf.

ognjen-petrovic avatar ognjen-petrovic commented on July 17, 2024

@tarikjabiri @tarikjabiri Great, thanks.
Wondering would it be helpful to add method "setPointStyle" to Drawing class?

from js-dxf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.