Multli-Line with auto-Trim

Do you have a question you want to ask an existing QCAD user about QCAD and what you can do with it? Do you want to know if a particular feature exists? This is the place to ask.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
Christian_R
Newbie Member
Posts: 3
Joined: Tue Jul 20, 2021 6:44 am

Multli-Line with auto-Trim

Post by Christian_R » Tue Jul 20, 2021 8:49 am

Hello together,

we´re searching for a new simple CAD solution, for creating some production draws, but we have some obstacles which I try to find a solution.

First point is that we need the function to create a draw from an XML-file which contains the dimensions of an exterior rectangle with inside the rectangle a specific count of vertical and horizontal bars. These bars have (dependend of the bar-type) specific connectors which should initially automaticall drawed:
connector.PNG
connector.PNG (7.95 KiB) Viewed 9274 times
I think it should be possible to work with scripts to achive this requirement.

The next problem we have is, that we want to draw just a single line and get the bar-type automatically drawed (afaik in Autocad there is a multi-line option and I hope to find a similar solution here).
linedraw.jpg
linedraw.jpg (15.13 KiB) Viewed 9274 times
With an auto-trim function we need the possibility to fit a bar on one side to the frame and if we move to a crossing bar we need a specific "closure" of the bar.
connector2.PNG
connector2.PNG (11.68 KiB) Viewed 9274 times
There I have no idea how to get this solution.


I hope the explanation of my request is my request is comprehensible and someone can give me some hints if (and if yes how) it´s possible to solve these problems.

Thanks a lot in advance.

BR
Christian

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

Re: Multli-Line with auto-Trim

Post by andrew » Tue Jul 20, 2021 9:24 am

Christian_R wrote:
Tue Jul 20, 2021 8:49 am
First point is that we need the function to create a draw from an XML-file which contains the dimensions of an exterior rectangle with inside the rectangle a specific count of vertical and horizontal bars. These bars have (dependend of the bar-type) specific connectors which should initially automaticall drawed:
I think it should be possible to work with scripts to achive this requirement.
Yes, you could develop a script with QCAD that reads the information from the XML file and generates the drawing based on that.
Christian_R wrote:
Tue Jul 20, 2021 8:49 am
The next problem we have is, that we want to draw just a single line and get the bar-type automatically drawed (afaik in Autocad there is a multi-line option and I hope to find a similar solution here).
QCAD does not have a multiline tool, so this is something you'd have to implement (i.e. a line tool which draws these bars and does the trimming).
Christian_R wrote:
Tue Jul 20, 2021 8:49 am
With an auto-trim function we need the possibility to fit a bar on one side to the frame and if we move to a crossing bar we need a specific "closure" of the bar.
Again, something to implement in a script. This is all possible as long as you know the logic that determines how the end result should look like. some of it might not be straight-forward though.

Christian_R
Newbie Member
Posts: 3
Joined: Tue Jul 20, 2021 6:44 am

Re: Multli-Line with auto-Trim

Post by Christian_R » Tue Jul 20, 2021 12:17 pm

Hallo Andrew,

thank you very much for the very fast answer.

This gives me hope that I can solve my problems with QCAD.

One more question, do you know where (or if) I can find some examples (especially from the line-tool-scripting) ?


Christian

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

Re: Multli-Line with auto-Trim

Post by andrew » Tue Jul 20, 2021 12:51 pm

All interactive tools and widgets in QCAD are implemented as scripts (at the top level). You can find these scripts of all existing tools at:
https://github.com/qcad/qcad/tree/master/scripts

For example the line tool:
https://github.com/qcad/qcad/tree/maste ... ine/Line2P
-> Line2P.js

Post Reply

Return to “Pre-sales Questions”