Calcualating length of lines in a layer

Post here to ask questions about or get help with the scripting module of QCAD 2.1/2.2.

Moderator: andrew

Calcualating length of lines in a layer

Postby Tomtefar » Mon Jun 15, 2009 5:21 pm

I'm using qcad to do some rather simple pipe drawing. I place every pipe on a separate layer, that way I can easily calculate the total length of each pipe with the "Total length of selected entities"-tool.
I was hoping to be able to do this rather automatically with a script. Is that possible? My approach was to use the "select layer" and then the tool previous mentioned, but the
Code: Select all
var sel = new Selection;

results in
Error. Use of undefined variable 'Selection'

Isn't there supposed to be a Selection class?

Some guidance would be very appreciated!
Tomtefar
Newbie Member
 
Posts: 5
Joined: Sun Jun 14, 2009 2:40 pm

Postby andrew » Tue Jun 16, 2009 7:09 pm

Entity selection / modification is not yet supported through scripting.
User avatar
andrew
Site Admin
 
Posts: 2602
Joined: Fri Mar 30, 2007 6:07 am

Postby Tomtefar » Wed Jun 17, 2009 8:07 am

I see. Will it be supported soon or should I start to write something (non-qcad-scripting) to get the data from the .dxf-file?
Tomtefar
Newbie Member
 
Posts: 5
Joined: Sun Jun 14, 2009 2:40 pm

Postby andrew » Wed Jun 17, 2009 5:32 pm

It will be supported in QCAD 3 (2010).
User avatar
andrew
Site Admin
 
Posts: 2602
Joined: Fri Mar 30, 2007 6:07 am

Postby Tomtefar » Fri Jun 19, 2009 5:03 pm

Did a little work on the test program in dxflib and managed to get what I want from there.
So if anyone is interested in calculating the length of Line entities in a drawing I got some source code, it may be a bit ugly, but it works for me :)
Tomtefar
Newbie Member
 
Posts: 5
Joined: Sun Jun 14, 2009 2:40 pm


Return to QCAD 2.1/2.2 Developers

Who is online

Users browsing this forum: No registered users and 1 guest

cron