Change programatically LineType property

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

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

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: 9037
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 Programming, Script Programming and Contributing”