Change programatically LineType property

Discussion forum for contributors and developers who are using the QCAD ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Post Reply
julia
Registered Member
Posts: 1
Joined: Mon Jan 22, 2018 8:14 pm

Change programatically LineType property

Post by julia » Mon Jan 22, 2018 8:16 pm

Hi,

Is there a possibility to change programatically LineType property of RLineEntity with ISO dash value ? I tried :

Code: Select all

var line = this.createLineEntity(this.getDocument(), point1, point2);
  line.setProperty(new RPropertyTypeId(6), 9); //***Don't know exact values to do**** 
  var op = new RAddObjectsOperation();
  op.addObject(line);
  this.getDocumentInterface().applyOperation(op);

Thanks.

User avatar
andrew
Site Admin
Posts: 5602
Joined: Fri Mar 30, 2007 6:07 am

Re: Change programatically LineType property

Post by andrew » Wed Feb 21, 2018 3:13 pm

Linetypes are objects stored in the document. Their IDs can be queried from the document:

Code: Select all

var line = this.createLineEntity(this.getDocument(), point1, point2);
line.setLinetypeId(this.getDocument().getLinetypeId("ACAD_ISO02W100")); 
var op = new RAddObjectsOperation();
op.addObject(line);
this.getDocumentInterface().applyOperation(op);

Post Reply

Return to “QCAD Developers and Contributors”