script question

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
jamby
Full Member
Posts: 55
Joined: Fri Jun 24, 2016 2:41 pm

script question

Post by jamby » Mon Nov 28, 2016 12:20 am

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

Matfie
Active Member
Posts: 37
Joined: Tue Aug 30, 2016 8:46 am

Re: script question

Post by Matfie » Mon Nov 28, 2016 9:30 pm

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..?

jamby
Full Member
Posts: 55
Joined: Fri Jun 24, 2016 2:41 pm

Re: script question

Post by jamby » Tue Nov 29, 2016 1:43 am

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

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

Re: script question

Post by andrew » Tue Nov 29, 2016 9:29 am

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.

jamby
Full Member
Posts: 55
Joined: Fri Jun 24, 2016 2:41 pm

Re: script question

Post by jamby » Wed Nov 30, 2016 4:17 am

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

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”