Page 1 of 1

script question

Posted: Mon Nov 28, 2016 12:20 am
by jamby
Hi
I am new to Qcad and JavaScript and object oriented. I've tried to follow some of the posts about scripts but many of them reference the mystical
"/Examples/DrawExamples/ExDrawBoundingBox/ExDrawBoundingBox.js" which doesn't seem to exist any more. Looking at the scripts in Misc/Draw/ I see exthreepoints.js and two others. But their structure seems to be different that the scripts that are in Misc/MiscDraw/ which use a Init.js and a .js file to define them. This is also the case in the Draw/Circle/ definitions. This leaves me scratching my head.
Are there any truly simple examples of circle, rectangle, line, point? Is there a list of the constructs other then the ones like this one at "http://www.qcad.org/doc/qcad/3.0/develo ... _data.html" ? Or am I looking for class definitions?

I would like to have a button that would give me a bisecting line .055 long with a .130 circle at its outward end. Then erase the line.

Hoping I don't need to take college level computer classes to get there.
Thanks
Jim

Re: script question

Posted: Mon Nov 28, 2016 9:30 pm
by Matfie
does it help that there is a BoundingBox script at:

Misc/MiscDraw/DrawBoundingBox/DrawBoundingBox.js

I don't know if that will help you to your destination, but perhaps it was just moved..?

Re: script question

Posted: Tue Nov 29, 2016 1:43 am
by jamby
Matfie

Yes it was right were you said. I was looking for it on web links in posts in the forum. And it is a good example of how to create a rectangle but I am still looking for examples of the other geometry elements.

Thanks
Jim

Re: script question

Posted: Tue Nov 29, 2016 9:29 am
by andrew
Have a look at the QCAD Simple API at:
http://www.qcad.org/doc/qcad/latest/dev ... imple.html

This will not solve your whole problem out of the box but might make your life a bit easier.

Re: script question

Posted: Wed Nov 30, 2016 4:17 am
by jamby
Andrew
It looks like the library will be what saves my sanity, whats left of it. OOPs can wait for another time, if ever.
thanks
Jim