[PythonCAD] Question about transferring objects between layers

Stuart Brorson sdb at cloud9.net
Tue Feb 7 22:39:48 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.

Actually, I suppose I would choose the KISS approach:  If the user
only selects the points to move, and doesn't select the segment too,
then let him move only the points.  Don't flag an error, and don't try
to do anything smart like moving the segment too.  It's really up to
the user to select all the objects he wants to move. 

OTOH, if the user selects only the segment, should the points move
also?  This case is more nuanced.  Question:  Must a segment have
endpoints in PythonCAD?  If so, what purpose do they serve?  For
example, can I click on them and drag them to stretch the segment?  If
so, they are part of the segment.  In that case, the points should get
autoselected when the user selects the segment, and they move with the

OTOH, If the endpoints don't do anything for the segment, why have
them in PythonCAD at all? 

> > (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 ...

Yes, I think PythonCAD should have both "move" and "copy" operations
which work between layers.



More information about the PythonCAD mailing list