[PythonCAD] Question about transferring objects between layers

Rafael Villar Burke pachi at mmn-arquitectos.com
Wed Feb 8 11:01:37 CET 2006


Art Haas escribió:
> Hi.
>
> As I wrote in an earlier message, I've started reworking the code that
> handles transferring objects between layers. While starting to make
> some of the planned changes, I thought of a scenario that could occur
> and wonder how other packages that use layers handle it.
>
> Suppose we have a segment S and its two endpoints P1 and P2. These three
> objects are in some layer, and now I decide to transfer either of the
> points to another layer. As both endpoints of the segment must be in
> the same layer as the segment itself, what should be the expected way to
> handle this operation? Should the program allow the point to move, and
> then by default transfer the segment as well, or should this operation
> raise an error?
In other CAD packages (my main experience is through using AutoCAD and 
CAD/FEM analysis tools, some Microstation work and having a look at what 
Arris and other CAD tools do), those points are internal entities and 
are usually referred to as "grips". They are just a convenience for the 
manipulation of those entities, but are a block with the main entity. 
Only in special cases (such as lines in a polyline, lines of text in a 
multitext element, or lines and other drawing elements in hatch 
patterns) those entities can be splitted using a "explode" command. In 
none of these cases points become new usable entities, they are there 
just as special points to manipulate entities (you don't draw them, BTW, 
you end up with them, but just as an implementation detail).
> So, how do other CAD packages that hold drawing entities in layers
> behave if the operation to transfer the entity results in the
> entity having pieces of itself in both layers? I am inclined to
> code things so that the entity is automagically transferred, but there
> will certainly be times this behavior will be unexpected.
>   
This is the most natural choice, IMHO. Other options are much more prone 
to weird semantics.
> Art
>   
Great work and I hope this helps you,

Rafael Villar Burke



More information about the PythonCAD mailing list