Parsing issue with some CAD entities

Hi All,

I am using Aspose CAD Java version to parse my cad files and want to get all the properties of various of entities. During this period, I don’t know how I can retrieve some specific properties. I am gonna list all these issues, hope you could tell me which Api could I use to get the value I need:

  1. the lock property of layers
  2. the start angle and end angle of ellipse
  3. the rotation of MText
  4. the closed of CadPolyline and CadPolyline3D

Thanks!

@jim_zhu

Could you please specify which specific properties you are trying to retrieve for the CAD entities mentioned?

@jim_zhu,

  1. The flag 4 (bit-coded) of a layer stores whether layer is locked:
CadLayerTable layer = ...;
System.out.println(layer.getName() + " " + ((layer.getFlags() & 4) == 4));
  1. StartAngle and EndAngle store the start and end parameters of the ellipse, not its angles directly. Please find the example how to get start angle (calculation of end angle is similar), this discussion could be helpful:
CadEllipse ellipse = ...;
System.out.println(Math.atan2(ellipse.getAxisRatio() * Math.sin(ellipse.getStartAngle()), Math.cos(ellipse.getStartAngle())));
  1. RotationAngleRad stores the rotation of the MTEXT typically, but it could be missing and DirectionVector could store angle instead, as described here
CadMText mtext = ...;
Cad3DPoint direction = mtext.getDirectionVector();
System.out.println(String.format("Direction = (%f, %f)", direction.getX(), direction.getY()));
  1. Proper flags are responsible for that, here are examples:
CadLwPolyline lwPolyline = ...;
System.out.println((lwPolyline.getFlag() & CadLwPolylineFlag.Closed) == CadLwPolylineFlag.Closed);

CadPolyline3D polyline = ...;
System.out.println((polyline.getFlag() & CadPolylineFlag.CLOSED_POLY) == CadPolylineFlag.CLOSED_POLY);