[PythonCAD] Consistency in operations in PythonCAD

Art Haas ahaas at airmail.net
Wed Dec 14 17:57:33 CET 2005

On Wed, Dec 14, 2005 at 07:28:04AM -0500, Stuart Brorson wrote:
> Hi -- 
> > > but I'd like to hear from
> > > people familiar with other CAD packages, particularly AutoCAD, how
> > > similar operations are performed. Does the program require you to select
> > > entities first, or do you start some move command mode and then specify
> > > which entities will be moved?
> > 
> > I can't recall how AutoCAD does it, but it used to be annoyingly
> > inconsistent.
> > 
> > My elderly version of IntelliCAD allows both:
> > 
> > 1. When idle, a click selects objects. A right-click then pops up the
> > context 
> > menu, which has 'move' as a choice.
> > 
> > 2. On the other hand, if I select 'move' from the pull-down menus, I get 
> > prompted to make a selection, a displacemet etc.
> > 
> > Option 1 (the context menu move) has my preference: no need to travel to
> > the top of the screen to pull down a menu, the pointer goes straight to
> > the object to select and stays there.
> I like this idea, and can consider implementing a right-button context
> window to complement the top-window menu bar and the <alt>-hotkeys.
> Art has done a fine job with architecting the program so extensions
> like this are easy. 

I've wanted some sort of right-click features in PythonCAD, but haven't
spent much time thinking about exactly what the features should be. If
you right click on some entity I think a menu should pop up offering you
editing options on that entity, a dialog showing the current attributes
as well as interesting values associated with the entity such as the
length for segments or area for circles, and maybe some other useful
actions. If you right-click over empty space in a drawing then the menu
that appears should offer choices more suitable to adjusting the active
layer properties, background color, or overall image attributes.

If anyone wants to play with adding right-click menus, you'd want to
look at the da_general_event() function in 'gtkimage.py', and add code
where the 'event.type' is 'gtk.gdk.BUTTON_PRESS' and the depressed
button is 3. Currently the code only invokes a 'button_press' event
handler if button 1 is depressed. Another location for this future code
could be in the window_general_event() function.

> > An alternative way - used by gschem - would be to use a combination of a 
> > keyboard hotkey (e.g. 'm' to move something) and a mouse click (to select
> > the object). This is really quick. once you get the hang of it.
> PythonCAD now uses hotkeys.  The first key is generally pressed with
> <alt>.  For example, to do a horizontal move, you do
> <alt>-e s ("edit", "select"), then click on the object to select.
> The selected object highlights.  Then you press <alt>-m m h (for
> "modify", "move", "horizontal"), and the object moves (and the
> highlight is cleared).
> Gschem, BTW, also has a pop-up menu which you get with a right mouse
> button click.  I like the way one drives gschem: It idles in the
> "select" mode, it maintains a strict "select
> then act" paradigm, and you have three ways to select the action:
> top-window menu, keyboard shortcut, and right mouse button pop-up
> menu.  I think PythonCAD could work the same way, and it's currently
> not far off from this behavior anyway.   

It seems like offering both "select then act" and "action then apply"
behavior is available in other CAD packages, so probably that is the way
PythonCAD should go. Both approaches have advantages for some scenarios,
and if you (the user) are used to working in one of these two manners,
you would probably want to use PythonCAD in the same fashion.

Another response to my initial mail reported that AutoCAD uses a
'PICKFIRST' variable to determine in which mode to behave. I'd like to
try and avoid the requirement of setting a variable if things can be
coded to behave more cleverly or if AutoCAD users find setting and
resetting this variable cumbersome. Is fiddling with 'PICKFIRST' an
issue or not? As for Intellicad, I'm guessing it has a similar variable
that toggles which mode it operates in. Correct? 

I've not used Gschem, nor have I used Intellicad, so I can't comment on
user experience with those two programs. As for AutoCAD, I haven't used
it in years, probably around the time AutoCAD release 12 came out. My
recollection of using it back then was that effective use of the program
only came after a steep learning curve was climbed, and I don't recall
the 'PICKFIRST' variable at all. It may not have been there or I may not
have dug into the program enough to find it, I don't know.

Any comments on other CAD packages people use?

Art Haas
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