Rubber lines and block snap points

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
kazmer
Junior Member
Posts: 18
Joined: Wed Aug 21, 2013 1:26 am

Rubber lines and block snap points

Post by kazmer » Mon Feb 24, 2014 2:27 pm

I am contemplating a thought experiment (operative words being contemplating and thought experiment :) ) of trying to turn QCAD into being able to create electrical wiring diagrams. It is kind of like an eletronics schematic, but it describes, in varying degrees, but relatively hight level o, detail, say the electrical wiring and lighting and switches and outlets and the like in your house or the control electronics of a motor or somesuch (see for example qelektrotech dot org for a similar application).

For this, I'd need the following features:
  • Blocks with snap points: say there is a block representing a motor.
    motor.png
    motor.png (4.12 KiB) Viewed 10154 times
    There need to be snap points to which wires can be attached (marked with red dots) when the block is placed on the drawing.
  • Rubber lines: wires need to be drawn in a "rubber line" fashion, that is, you start a wire some place, it will follow the mouse pointer around (possibly following some restrictions along the way, like horizontal and vertical only, 45 degrees, what have you), and can usually only be finished at some other entity's snap point (sometimes also "in the air").
  • When an entity with a rubber line attached to it is moved, the rubber lines also move.
So it's kind of like an eletronics CAD, but not really.

Does QCAD have these features and if yes, what are they called? (I can probably manage for a bit if I know what is it I am looking for :) .) If not, is it feasible for these features to be implemented in the QCAD kernel? Shall I perhaps start a poll for these? :) (There should probably be more input from other interested parties first.)

I am not really aiming high, at least not for starters -- I think something that can be reasonably used to draw an architectural plan of your property and put your electrical/plumbing/gas/HVAC stuff in so that electrical/plumbing/gas/HVAC people don't have to feel their way in the dark when doing work on your property is a good start. The foundation for the architectural part is here already, but the other disciplines need some tools we don't have yet (or I can't find them).

Is QCAD a good base for something like this at all, or should I be better off looking elsewhere? As far as I can tell someone tried this a while back, see ewcad dot sourceforge dot net, but it never went past the "oh, I haz a good idea!" phase. Not to say I won't get stuck here too :).

Inputs much appreciated.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Rubber lines and block snap points

Post by Husky » Mon Feb 24, 2014 8:42 pm

First of all: I'm not an electrician and all what I know about electrical wiring diagram is: Put plus and minus together and it will - at least - smell very badly! :lol: :lol: :lol:

However - here are my 2 cents to this target specification:
kazmer wrote: For this, I'd need the following features:
  • Blocks with snap points: say there is a block representing a motor.
    motor.png
    There need to be snap points to which wires can be attached (marked with red dots) when the block is placed on the drawing.
  • Rubber lines: wires need to be drawn in a "rubber line" fashion, that is, you start a wire some place, it will follow the mouse pointer around (possibly following some restrictions along the way, like horizontal and vertical only, 45 degrees, what have you), and can usually only be finished at some other entity's snap point (sometimes also "in the air").
  • When an entity with a rubber line attached to it is moved, the rubber lines also move.
Blocks are all stored with ONE Reference point which can be used to attach the block precisely to a wire. Before you attach the block you are also able to: flip horizontal, flip vertical, scale or rotate the Block before you place it finally in the drawing. Most of the time it works perfect - just a matter how smart the Reference point for the Block is chosen ... :wink:

The "rubber line"
Already part of QCAD - it's called "Line from two points Ex" (LX)
This line is able to work "free", or with all snap points or even restricted to angles.

Entity with rubber lines moving:
Right now - for this electrical matter - I don't see a nice working solution in the currently QCAD application. Yes, there are different ways to select those parts and move them together or you could explode (destroy) a Block formation to modify the shape but I don't think that is what you are looking for. :cry:

Hope this info will help you on your way .....

khad
Newbie Member
Posts: 9
Joined: Wed Nov 06, 2013 12:28 pm

Re: Rubber lines and block snap points

Post by khad » Tue Feb 25, 2014 1:55 am

I'm a very occasional user of QCAD, and as such not really in a position to answer your question, but I'll add my two cents here anyway:

- If you are looking for EDA, you're obviously wrong here (head on for kicad), but I think you know that.
- If you are looking for something to give you limited diagramming capabilities on top of a generic drafting package (with clear emphasis on drafting), I don't know of any other (open source) tool that could do the job, so you might want to investigate QCAD further - but here are the caveats:

QCAD does not currently cater for your wishes, and since it uses dxf/dwg as its file format, it would IMO be no easy task to implement such things, although it is certainly possible: dwg allows for relations between entities, and you can create elaborate constraint systems on top of that (have a look at BricsCAD for example). Additionally, AutoCAD has Dynamic Blocks, which offer some of the functionality you seem to have in mind, but they are so complicated (and IMO of limited use) that even Bricsys so far refrained from implementing them fully.

I think that the main feature you're asking for (connectors) does make sense for a generic CAD package, and that there probably is a straightforward way to implement it (e.g. point data shared among objects) - but this would mean breaking the boundaries of dwg, which is likely not a short term option (given the fact that QCAD professional just acquired dwg compatibility).

My Shot at emulating this feature without coding would be to include points on a specific layer in my blocks, and then use a combination of grid and node (point) snap for placement / drafting. Unfortunately, I don't see how to do the latter in QCAD...

Something that could perhaps be implemented without too much fuss is a flag in Extended Entity Data to indicate if a block should be treated as a symbol - meaning its geometry should be ignored for snapping, with the exception of points (perhaps further restricted to a certain layer).

kazmer
Junior Member
Posts: 18
Joined: Wed Aug 21, 2013 1:26 am

Re: Rubber lines and block snap points

Post by kazmer » Tue Mar 04, 2014 1:05 pm

I've been giving this some more thought, and it indeed seems QCAD is not the right base for this kind of application.

Thanks for the great insights, guys!

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”