Search found 13 matches

by socool
Thu Jul 26, 2012 3:28 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting question

Thanks for your help Andrew.
by socool
Thu Jul 26, 2012 3:14 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting question

Hello, I use some parameters for my commandline script. I load it by command: var parameter1 = args[1]; If parameter is number it is load as string, but I need load it as integer. I multiply it by 1 to create integer: var parameter1 = args[1] * 1; But probably it isn't clear solution, how can I set ...
by socool
Thu Jul 19, 2012 6:33 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting question

How can I use function defined in other file. I have function in file "FileWithFunction.js" function myFunction(varieble1, varieble2){ ... }; In file "Script.js" I want to us this funcion var result = myFunction(a, b); I try include file with function at begin of script file: include("FileWithFuncti...
by socool
Tue Jul 17, 2012 7:06 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting question

Thanks for your help Andrew.
by socool
Mon Jul 16, 2012 6:39 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting question

Hello, can you help me with correct syntax for write text to file. I know how to read text from file line by line, I use it to read coordinates: var file file = new QFile(file_name); var file_info = new QFileInfo(file); if (!file_info.exists()) { throw new Error("File " + file_name + " not exist"); ...
by socool
Thu Jul 05, 2012 3:48 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting question

Thanks for all your help Andrew.
by socool
Sun Jul 01, 2012 7:12 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting quetion

Thanks for help with button. Now I'm not sure if is clear create layer by script in current document provided I don't know that layer with this name didn't be created in this document yet. Or it's better fist check, by some condition, that layer don't exist. Something like: if (RLayer.getName() != "...
by socool
Sun Jul 01, 2012 4:27 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting quetion

Thanks for your help Andrew. This is what I was looking for. I have one more question to Persistent Widgets in tutorial. There are only two buttons in one Button Box. "OK" Store the new user input, "Cancel" terminate function. How can I set action to other buttons in my GUI. I want to create third b...
by socool
Sat Jun 30, 2012 8:38 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting quetion

In the tutorial "Command Line Tools > Creating a Drawing" start with new document. How can I start with current .dwg file with some drawing and continue drawing to this file by command line script (no-gui mode). I can create Tool by tutorial "Creating a New Tool" which can do that, but it can't run ...
by socool
Sat Jun 30, 2012 2:29 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting quetion

Thanks for the link. The tutorial was very useful for me.
by socool
Mon Jun 25, 2012 7:02 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting quetion

I start with script to draw a spiral. ExMathSpiral. I can change the body of function to draw something else, but I'm not able to change function name, script file name and directory with script. Probably there is some dependences to other files in directory MathExamples but I don't know which one. ...
by socool
Mon Jun 25, 2012 12:05 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Re: Scripting quetion

Thanks for your help. Pleas can you tell me what is wrong in this simple script: var document = this.getDocument(); var di = this.getDocumentInterface(); var poloha = new RVector(10, 20); var operation2 = new RAddObjectsOperation(); operation2.addObject(new RCircleEntity(document, new RCircleData(po...
by socool
Sun Jun 17, 2012 12:57 pm
Forum: QCAD Programming, Script Programming and Contributing
Topic: Scripting question
Replies: 21
Views: 45871

Scripting question

Hello I'm new in QCad scripting. I use QCad 3.0.0 RC5 Trial for Linux. I have two questions. 1) How can I add something to current DWG or DXF file by my script. I use: // init application name: qApp.applicationName = "Nacti body"; // init DWG / DXF exporter: RDwgExporterFactory.registerFileExporter(...

Go to advanced search