[PythonCAD] Question about transferring objects between layers

Art Haas ahaas at airmail.net
Tue Feb 7 22:02:57 CET 2006

On Tue, Feb 07, 2006 at 03:43:25PM -0500, Stuart Brorson wrote:
> Hi --
> > 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?
> I guess my question would be:  Why would I want to transfer only the
> points?   Is there a use case where only the points need transerring,
> and not the segment?

I was thinking that user might try to perform an entity transfer by
selecting points, either interactively or through a script. Normally I
would suspect that someone wanting to transfer a segment from layer A to
layer B would select the segment to do the operation, but there is
nothing in the code now to prohibit trying to do this via point
transfer. I'm trying to cover all the bases, and if that approach
doesn't work then the next step is to start restricting the way that
some task can be accomplished.

> (I suppose you might want to *copy* some points from one layer to
> another, but that's a different use than *moving* the points.)

It is, but what you wrote above made me think that a 'clone-to-layer'
operation would be useful. I have to keep that idea around ...

> > If the segment was to be transferred between layers, it will
> > automagically transfer the points if possible (in the initial writing
> > of the new code), so there is an implicit object transferring
> > in some operations already. 
> Sounds reasonable to me.

Thanks for the comments.

Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822

More information about the PythonCAD mailing list