From ahaas at airmail.net Mon Dec 5 18:04:16 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 5 Dec 2005 11:04:16 -0600 Subject: [PythonCAD] Expect a release this week Message-ID: <20051205170416.GE2481@artsapartment.org> Hi. As the last release was at the end of October, I'm thinking that another release is due. While there have not been massive amounts of changes since the last release, a number of good bug fixes have been applied, so for people not accessing the code via subversion, an official release would be useful. So, expect a release within a day or two. After then, I'd like to try and tackle addressing some of the issues regarding saving user preferences, and I'd also like to push on replacing the GTKImage class with the ImageView/ImageWindow approach. Art -- 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 From ahaas at airmail.net Mon Dec 5 20:29:04 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 5 Dec 2005 13:29:04 -0600 Subject: [PythonCAD] Expect a release this week In-Reply-To: <20051205170416.GE2481@artsapartment.org> References: <20051205170416.GE2481@artsapartment.org> Message-ID: <20051205192904.GH2481@artsapartment.org> On Mon, Dec 05, 2005 at 11:04:16AM -0600, Art Haas wrote: > Hi. > > As the last release was at the end of October, I'm thinking that another > release is due. While there have not been massive amounts of changes > since the last release, a number of good bug fixes have been applied, > so for people not accessing the code via subversion, an official release > would be useful. So, expect a release within a day or two. After then, > I'd like to try and tackle addressing some of the issues regarding > saving user preferences, and I'd also like to push on replacing the > GTKImage class with the ImageView/ImageWindow approach. Hi. A short followup - I've just added a 'Deselect' menu choice and the code to permit deselecting some/all of the currently selected objects. The core code has had this ability for some time, there was no interface code written to utilize it, however. Also, the recent selection highlighting work brought a mail message or two about adding deselection, so here's the first pass. Art -- 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 From ahaas at airmail.net Wed Dec 7 17:45:16 2005 From: ahaas at airmail.net (Art Haas) Date: Wed, 7 Dec 2005 10:45:16 -0600 Subject: [PythonCAD] [ANNOUNCE] Twenty-seventh release of PythonCAD now available Message-ID: <20051207164516.GO2481@artsapartment.org> Hi. I'm pleased to announce the twenty-seventh development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually exceed features found in commercial CAD software. PythonCAD is released under the GNU Public License (GPL). PythonCAD requires Python 2.2 or newer. The interface is GTK 2.0 based, and uses the PyGTK module for interfacing to GTK. The design of PythonCAD is built around the idea of separating the interface from the back end as much as possible. By doing this, it is hoped that both GNOME and KDE interfaces can be added to PythonCAD through usage of the appropriate Python module. Addition of other PythonCAD interfaces will depend on the availability of a Python module for that particular interface and developer interest and action. The twenty-seventh release contains primarily bug fixes and internal code enhancements. A long-standing interface problem where the display of selected entities was not clear has been fixed. When you select an entity it is redrawn in a highlighting color, making it clear which entities are selected at any one time. Also, the ability to deselect a selected entity has been added to the interface. The bug fixes included in this release address a few problems introduced in the previous release as well as various older issues. A mailing list for the development and use of PythonCAD is available. Visit the following page for information about subscribing and viewing the mailing list archive: http://mail.python.org/mailman/listinfo/pythoncad Visit the PythonCAD web site for more information about what PythonCAD does and aims to be: http://www.pythoncad.org/ Come and join me in developing PythonCAD into a world class drafting program! 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 From w.knol at niwa.co.nz Wed Dec 7 22:05:05 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Thu, 8 Dec 2005 10:05:05 +1300 Subject: [PythonCAD] Twenty-seventh release of PythonCAD now available In-Reply-To: <20051207164516.GO2481@artsapartment.org> References: <20051207164516.GO2481@artsapartment.org> Message-ID: <200512081005.05449.w.knol@niwa.co.nz> > I'm pleased to announce the twenty-seventh development release of > PythonCAD Downloaded in 5 seconds with Subversion....great tool! A minor quirk: having started the program, I changed the dimension marker from 'none' to 'arrow'. I then drew a circle and attempted to add a radial dimension to the circle. The operation failed: [wk at wk pythoncad]$ /usr/local/bin/gtkpycad.py Traceback (most recent call last): File "/home/wk/pythoncad/PythonCAD/Interface/Gtk/gtkimage.py", line 134, in da_general_event event, _tool) File "/home/wk/.subversion/pythoncad/PythonCAD/Interface/Gtk/gtkdimension.py", line 219, in radial_text_button_press_cb File "/home/wk/.subversion/pythoncad/PythonCAD/Interface/Gtk/gtkdimension.py", line 100, in add_dimension File "/home/wk/pythoncad/PythonCAD/Interface/Gtk/gtkimage.py", line 1066, in redraw self.drawLayer(_active_layer) File "/home/wk/pythoncad/PythonCAD/Interface/Gtk/gtkimage.py", line 1101, in drawLayer _obj.draw(self, _col) File "/home/wk/.subversion/pythoncad/PythonCAD/Interface/Gtk/gtkinit.py", line 739, in _draw_rdim IndexError: list index out of range Wilbert. From ahaas at airmail.net Wed Dec 7 23:10:00 2005 From: ahaas at airmail.net (Art Haas) Date: Wed, 7 Dec 2005 16:10:00 -0600 Subject: [PythonCAD] Twenty-seventh release of PythonCAD now available In-Reply-To: <200512081005.05449.w.knol@niwa.co.nz> References: <20051207164516.GO2481@artsapartment.org> <200512081005.05449.w.knol@niwa.co.nz> Message-ID: <20051207221000.GT2481@artsapartment.org> On Thu, Dec 08, 2005 at 10:05:05AM +1300, Wilbert Knol wrote: > > > I'm pleased to announce the twenty-seventh development release of > > PythonCAD > > Downloaded in 5 seconds with Subversion....great tool! > > A minor quirk: having started the program, I changed the dimension > marker from 'none' to 'arrow'. I then drew a circle and attempted to > add a radial dimension to the circle. The operation failed: > > [wk at wk pythoncad]$ /usr/local/bin/gtkpycad.py > Traceback (most recent call last): > File "/home/wk/pythoncad/PythonCAD/Interface/Gtk/gtkimage.py", line 134, in da_general_event > event, _tool) > File "/home/wk/.subversion/pythoncad/PythonCAD/Interface/Gtk/gtkdimension.py", line 219, in radial_text_button_press_cb > File "/home/wk/.subversion/pythoncad/PythonCAD/Interface/Gtk/gtkdimension.py", line 100, in add_dimension > File "/home/wk/pythoncad/PythonCAD/Interface/Gtk/gtkimage.py", line 1066, in redraw > self.drawLayer(_active_layer) > File "/home/wk/pythoncad/PythonCAD/Interface/Gtk/gtkimage.py", line 1101, in drawLayer > _obj.draw(self, _col) > File "/home/wk/.subversion/pythoncad/PythonCAD/Interface/Gtk/gtkinit.py", line 739, in _draw_rdim > IndexError: list index out of range > > > > Wilbert. Dang, a bug. I'll try and fix it and send a patch out. Thanks for the traceback. Art -- 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 From ahaas at airmail.net Thu Dec 8 23:42:13 2005 From: ahaas at airmail.net (Art Haas) Date: Thu, 8 Dec 2005 16:42:13 -0600 Subject: [PythonCAD] Twenty-seventh release of PythonCAD now available In-Reply-To: <200512081005.05449.w.knol@niwa.co.nz> References: <20051207164516.GO2481@artsapartment.org> <200512081005.05449.w.knol@niwa.co.nz> Message-ID: <20051208224213.GW2481@artsapartment.org> Hi. Here's a patch that fixed the problem for me. The location of the various endpoints (arrow, filled arrow, slash) are determined in the calcDimValues() routines, and invoking this call just before the addObject() call ensures that the calculations are performed when the endpoint type is set in the dimension entity. I've commited this patch to the repo, and will probably post it on the web site for people using the tar archives. Please let me know if the patch fixes the problem for you. Art Index: PythonCAD/Generic/tools.py =================================================================== --- PythonCAD/Generic/tools.py (revision 2088) +++ PythonCAD/Generic/tools.py (revision 2089) @@ -2519,6 +2519,7 @@ _sds.setSuffix(image.getOption('DIM_SECONDARY_SUFFIX')) finally: _sds.unmute() + _ldim.calcDimValues() image.addObject(_ldim) self.reset() @@ -2582,6 +2583,7 @@ _sds.setSuffix(image.getOption('DIM_SECONDARY_SUFFIX')) finally: _sds.unmute() + _hdim.calcDimValues() image.addObject(_hdim) self.reset() @@ -2642,6 +2644,7 @@ _sds.setSuffix(image.getOption('DIM_SECONDARY_SUFFIX')) finally: _sds.unmute() + _vdim.calcDimValues() image.addObject(_vdim) self.reset() @@ -2774,6 +2777,7 @@ finally: _sds.unmute() _rdim.setDiaMode(image.getOption('RADIAL_DIM_DIA_MODE')) + _rdim.calcDimValues() image.addObject(_rdim) self.reset() @@ -2874,6 +2878,7 @@ _sds.setSuffix(image.getOption('ANGULAR_DIM_SECONDARY_SUFFIX')) finally: _sds.unmute() + _adim.calcDimValues() image.addObject(_adim) self.reset() -- 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 From w.knol at niwa.co.nz Fri Dec 9 01:41:36 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Fri, 9 Dec 2005 13:41:36 +1300 Subject: [PythonCAD] Twenty-seventh release of PythonCAD now available In-Reply-To: <20051208224213.GW2481@artsapartment.org> References: <20051207164516.GO2481@artsapartment.org> <200512081005.05449.w.knol@niwa.co.nz> <20051208224213.GW2481@artsapartment.org> Message-ID: <200512091341.37105.w.knol@niwa.co.nz> On Friday 09 December 2005 11:42, Art Haas wrote: > Here's a patch that fixed the problem for me. Thanks, Art. It applied perfectly, and fixed the problem here, too. Something else: while test-driving the patch, I had a play with the 'dimension text position'. I tried the various options 'splitting', 'above' and 'below'. In each case a horizontal dimension looks exactly the same: the same dimension text both above and below the dimension bar, and a couple of small notches in the dimension bar on near the dimension text. Not sure if this is a bug or a feature. Wilbert. From ahaas at airmail.net Fri Dec 9 02:16:48 2005 From: ahaas at airmail.net (Art Haas) Date: Thu, 8 Dec 2005 19:16:48 -0600 Subject: [PythonCAD] Twenty-seventh release of PythonCAD now available In-Reply-To: <200512091341.37105.w.knol@niwa.co.nz> References: <20051207164516.GO2481@artsapartment.org> <200512081005.05449.w.knol@niwa.co.nz> <20051208224213.GW2481@artsapartment.org> <200512091341.37105.w.knol@niwa.co.nz> Message-ID: <20051209011648.GX2481@artsapartment.org> On Fri, Dec 09, 2005 at 01:41:36PM +1300, Wilbert Knol wrote: > On Friday 09 December 2005 11:42, Art Haas wrote: > > > Here's a patch that fixed the problem for me. > > Thanks, Art. It applied perfectly, and fixed the problem here, too. Good. > Something else: while test-driving the patch, I had a play with the > 'dimension text position'. I tried the various options 'splitting', > 'above' and 'below'. > > In each case a horizontal dimension looks exactly the same: the same > dimension text both above and below the dimension bar, and a couple > of small notches in the dimension bar on near the dimension text. > > Not sure if this is a bug or a feature. The dimension text position is not working now, and I'm not sure if it will be replaced with something else in the future. Eventually I'd like to be able and adjust the positioning of horizontal and vertical dimensions so that the text block can be move off the dimension bar, but implementing this was complicated when I first started, and there are numerous other development tasks to tackle. I'd welcome patches to make this feature work, but I suspect the patches will be large and require changes to many files. Thanks again for letting me know the patch fixed the bug you reported. 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 From sdb at cloud9.net Fri Dec 9 20:09:01 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Fri, 09 Dec 2005 14:09:01 -0500 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <20051209011648.GX2481@artsapartment.org> References: <20051207164516.GO2481@artsapartment.org> <200512081005.05449.w.knol@niwa.co.nz> <20051208224213.GW2481@artsapartment.org> <200512091341.37105.w.knol@niwa.co.nz> <20051209011648.GX2481@artsapartment.org> Message-ID: <20051209140901.z91dgnvtsk0gso4g@www.mail.cloud9.net> Art and PythonCADsters -- I've been silent for a while! Thanks for the most recent release of PythonCAD! I have recently had a little time to do some hacking on PythonCAD. In particular, I have implemented the following two changes: 1. I have long wanted to move objects on the following way: 1. Select all objects to be moved. They highlight upon selection. 2. Do "modify -> move -> move horizontal" 3a. 1 The user types in the distance to move. The numerical distance appears in the text Entry widget at the bottom of the screen. 3a. 2 Hit . The selected objects move, and are automatically deselected after the move. ----------- ------------ 3b. 1. The user presses the first left mouse button to define a move distance. 3b. 2. The user presses the second left mouse button to define the move distance. The selected objects move, and are automatically deselected after the move. As you know, the way it works now is: 1. Do "modify -> move -> move horizontal". 2. Define move distance. 3. Select items to move. Personally, I think it makes more sense to first select the items you want to act upon, and then do the action. Right now PythonCAD is mixed: some actions are done by selecting first, then acting, and others are done by choosing the action and then selecting the objects. As a user, I favor a consistant interface, and one where you select first and then act is the most common, most logical, and most up-to-date. I have modified only the "modify -> move -> move horizontal" action to work in my preferred way. I wanted to see how open you were to this kind of change. If you do like the change, then I can modify all the other actions to behave this way also. If you don't like it, that's too bad for me, but at least I didn't make zillions of changes. In any event, but I really think that "select first, then act" is the best way to drive PythonCAD, and I would appreciate it if you gave this method some thought. Note that I had to make one architectural change to make "select first, then act" work for text objects: I had to make TextBlock a subclass of GraphicObject (it was subclassed to Entity). Without this change, text wouldn't move using PythonCAD.Generic.move.move_objects(). Now moving text works, but I get lots warning spew when the program is run and addStyle is called. The program seems to work anyway. The warning spew occurs because _layerAddedChild tries to setStyle or getStyle on the text. Maybe I need to add a Style parameter to TextBlock? Or make the conditional (isinstance(_obj, GraphicObject)) return true for text by defining a different type of class which can be moved? In any event, if you don't like my changes, I didn't want to get too far ahead in cleaning up this issue. 2. Next change: Added stuff to Entry, TreeView, and window_general_event to try to make entry box behave as I want, but also pass arrow keys to the TreeView, which is what you want. That is, I want to type numbers into the Entry widget at the bottom of the window when asked for numerical input (e.g. when making a move). My changes seem to work, but you must sometimes first select the LayerDisplay area with the mouse. That is, when the Entry box has the focus, it doesn't let any arrow keys past it to get to the TreeView. I can look at that more, but first wanted to gague your interest in this change. Please find my patches attached here. Please let me know how interested you are in these changes, and depending upon your interest I can continue working on cleaning them up, or I can drop them. BTW: the patches are done against revision 2077, which is the last time I was able to do an "svn update". If this presents a problem, please let me know. Finally, Art, you have mentioned several times doing away with GTKImage and replacing it with ImageView and ImageWindow. I may have asked this previously, but could you please give a quick top-level overview of what functionality these two classes are supposed to implement. I more or less understand GTKImage (it's the top-level class for the entire user interface), but I'm less certain what ImageView and ImageWindow are all about. Thanks, Stuart -------------- next part -------------- A non-text attachment was scrubbed... Name: PythonCAD_20051209.diff.gz Type: application/gzip Size: 4276 bytes Desc: not available Url : http://mail.python.org/pipermail/pythoncad/attachments/20051209/b75b3eb1/PythonCAD_20051209.diff.bin From Neuman at fastwebnet.it Sat Dec 10 23:52:23 2005 From: Neuman at fastwebnet.it (Neuman) Date: Sat, 10 Dec 2005 22:52:23 +0000 Subject: [PythonCAD] problem to launch PythonCAD Message-ID: <200512102252.24107.Neuman@fastwebnet.it> Hi all, I'm quite new with Linux and Python (so please be tolerant with my noobie's questions), I was searching a CAD program released under GPL and PythonCAD seems to fit my needs but I have have encountered some problem.... I have installed the program on my desktop , but when I try to launch it with "gtkpycad.py" it tell me: Traceback (most recent call last): File "/usr/local/bin/gtkpycad.py", line 30, in ? import pygtk ImportError: No module named pygtk Well, I checked if my pygtk was correctly installed, I launched the command "rpm -qa | grep pygtk" and it gives me the following output: pygtk2.0-libglade-2.3.96-1mdk pygtk2.0-wrapper-2.3.96-1mdk pygtk2.0-2.3.96-1mdk So, the pygkt is correctly installed but python cannot view it. What is wrong about it? I use Python 2.4.1, Mandrake Linux 10.1. Thanks to all Dario From ahaas at airmail.net Mon Dec 12 03:29:55 2005 From: ahaas at airmail.net (Art Haas) Date: Sun, 11 Dec 2005 20:29:55 -0600 Subject: [PythonCAD] problem to launch PythonCAD In-Reply-To: <200512102252.24107.Neuman@fastwebnet.it> References: <200512102252.24107.Neuman@fastwebnet.it> Message-ID: <20051212022955.GB2481@artsapartment.org> On Sat, Dec 10, 2005 at 10:52:23PM +0000, Neuman wrote: > Hi all, > > I'm quite new with Linux and Python (so please be tolerant with my noobie's > questions), I was searching a CAD program released under GPL and PythonCAD > seems to fit my needs but I have have encountered some problem.... > > I have installed the program on my desktop , but when I try to launch it with > "gtkpycad.py" it tell me: > > Traceback (most recent call last): > File "/usr/local/bin/gtkpycad.py", line 30, in ? > import pygtk > ImportError: No module named pygtk > > Well, I checked if my pygtk was correctly installed, I launched the command > "rpm -qa | grep pygtk" and it gives me the following output: > > pygtk2.0-libglade-2.3.96-1mdk > pygtk2.0-wrapper-2.3.96-1mdk > pygtk2.0-2.3.96-1mdk > > So, the pygkt is correctly installed but python cannot view it. > What is wrong about it? > > I use Python 2.4.1, Mandrake Linux 10.1. > > Thanks to all Hi. I don't have a Mandrake machine to test with, so based on what the listed pygtk package you have installed I would have guessed PythonCAD should have started. What you may want to try is installing a '-devel' package for pygtk, as maybe that package has some of the libraries or files needed for pygtk apps to run, but this suggestion is only a guess. What happens when you manually start python and try to import the 'pygtk' module ... $ python >>> import pygtk Does that work? 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 From ahaas at airmail.net Mon Dec 12 16:58:32 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 12 Dec 2005 09:58:32 -0600 Subject: [PythonCAD] New subversion binaries installed Message-ID: <20051212155832.GC2481@artsapartment.org> Hi. I've update Apache and Subversion to their latest developement releases, so please report any problems accessing the repository. The machine hosting the repo was rebooted and my httpd process was not restarted, so I used this unexpected downtime to perform the upgrade. Art -- 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 From ahaas at airmail.net Mon Dec 12 20:39:36 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 12 Dec 2005 13:39:36 -0600 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <20051209140901.z91dgnvtsk0gso4g@www.mail.cloud9.net> References: <20051207164516.GO2481@artsapartment.org> <200512081005.05449.w.knol@niwa.co.nz> <20051208224213.GW2481@artsapartment.org> <200512091341.37105.w.knol@niwa.co.nz> <20051209011648.GX2481@artsapartment.org> <20051209140901.z91dgnvtsk0gso4g@www.mail.cloud9.net> Message-ID: <20051212193936.GF2481@artsapartment.org> On Fri, Dec 09, 2005 at 02:09:01PM -0500, Stuart Brorson wrote: > > I've been silent for a while! Thanks for the most recent release of > PythonCAD! Glad you like it! > I have recently had a little time to do some hacking on PythonCAD. In > particular, I have implemented the following two changes: > > 1. I have long wanted to move objects on the following way: > > 1. Select all objects to be moved. They highlight upon > selection. > 2. Do "modify -> move -> move horizontal" > 3a. 1 The user types in the distance to move. > The numerical distance appears in > the text Entry widget at the bottom of the screen. > 3a. 2 Hit . The selected objects move, and are > automatically deselected after the move. > ----------- ------------ > 3b. 1. The user presses the first left mouse button to define a > move distance. > 3b. 2. The user presses the second left mouse button to define > the move distance. The selected objects move, and > are automatically deselected after the move. > > > As you know, the way it works now is: 1. Do "modify -> move -> move > horizontal". 2. Define move distance. 3. Select items to move. > > Personally, I think it makes more sense to first select the items you > want to act upon, and then do the action. Right now PythonCAD is > mixed: some actions are done by selecting first, then acting, and > others are done by choosing the action and then selecting the > objects. As a user, I favor a consistant interface, and one where you > select first and then act is the most common, most logical, > and most up-to-date. > > I have modified only the "modify -> move -> move horizontal" action to > work in my preferred way. I wanted to see how open you were to this > kind of change. If you do like the change, then I can modify all the > other actions to behave this way also. If you don't like it, that's > too bad for me, but at least I didn't make zillions of changes. In > any event, but I really think that "select first, then act" is the > best way to drive PythonCAD, and I would appreciate it if you gave > this method some thought. The current move behavior, that is the distance specification prior to the entity specification, was how I remember doing move operations in ME-10. As you point out, this approach is inconsistent with other PythonCAD operations, and in many cases the reverse procedure in how other programs expect the user to modify the entities built and controlled in that program. The internal PythonCAD inconsistency has become more bothersome to me, and a note to fix things was added into the TODO file included in the latest release. So, I definitely want to make some changes so that PythonCAD is consistent and performing one type of operation should at least give you a reasonable guess on the steps needed to perform some other change. > Note that I had to make one architectural change to make "select > first, then act" work for text objects: I had to make TextBlock a > subclass of GraphicObject (it was subclassed to Entity). Without this > change, text wouldn't move using > PythonCAD.Generic.move.move_objects(). Now moving text works, but I > get lots warning spew when the program is run and addStyle is called. > The program seems to work anyway. The warning spew occurs because > _layerAddedChild tries to setStyle or getStyle on the > text. Maybe I need to add a Style parameter to TextBlock? Or make > the conditional (isinstance(_obj, GraphicObject)) return true for > text by defining a different type of class which can be moved? In any > event, if you don't like my changes, I didn't want to get too far > ahead in cleaning up this issue. I don't like the change to the TextBlock class, because making that class be a subclass of GraphicObject implies that at TextBlock needs the style, linetype, and thickness attributes that a GraphicObject instance utilizes. A peek at move_objects() suggests that there should not be any changes needed to handle moving TextBlocks, so I'm not sure why the change was necessary. After I dig into things a little deeper maybe I'll achieve enlightenment. I'm going to make the change to the horizontal moving to behave as your patch would have it, and I'll use some of your changes as a starting point. I suspect that I'll tweak some of your changes a bit, so what I'll do is send out some diffs when things look like I think they should, then we can see how things looks. > 2. Next change: Added stuff to Entry, TreeView, and > window_general_event to try to make entry box behave as I want, but > also pass arrow keys to the TreeView, which is what you want. That > is, I want to type numbers into the Entry widget at the bottom of the > window when asked for numerical input (e.g. when making a move). My > changes seem to work, but you must sometimes > first select the LayerDisplay area with the mouse. That is, when the > Entry box has the focus, it doesn't let any arrow keys past it to get > to the TreeView. I can look at that more, but first wanted to gague > your interest in this change. I'll look at this stuff after playing with the move changes. Again, I definitely want making numerical input from the keyboard work when the focus is in the layer display, as the unexpected appearance of the entry box is, well, unexpected. > Please find my patches attached here. Please let me know how > interested you are in these changes, and depending upon your interest > I can continue working on cleaning them up, or I can drop them. BTW: > the patches are done against revision 2077, which is the last time I > was able to do an "svn update". If this presents a problem, please let > me know. You should be able to do an 'svn update' today. If not let me know and I'll see if I can figure out what is wrong. > Finally, Art, you have mentioned several times doing away with GTKImage and > replacing it with ImageView and ImageWindow. I may have asked this > previously, > but could you please give a quick top-level overview of what > functionality these > two classes are supposed to implement. I more or less understand > GTKImage (it's > the top-level class for the entire user interface), but I'm less certain > what > ImageView and ImageWindow are all about. In brief, the ImageView is meant to display a drawing area with some portion of the Image displayed within. An ImageWindow is meant to be the graphical container for the Image itself. I'd like to code things so that a user can display numerous ImageViews of some Image at any given time, and each ImageView will properly update itself when the data in the underlying Image changes. There will only be one ImageWindow associated with the Image, however. I'll need to go into more detail on my ideas for these classes again. 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 From w.knol at niwa.co.nz Mon Dec 12 21:33:02 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Tue, 13 Dec 2005 09:33:02 +1300 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <20051209140901.z91dgnvtsk0gso4g@www.mail.cloud9.net> References: <20051207164516.GO2481@artsapartment.org> <20051209011648.GX2481@artsapartment.org> <20051209140901.z91dgnvtsk0gso4g@www.mail.cloud9.net> Message-ID: <200512130933.03365.w.knol@niwa.co.nz> On Saturday 10 December 2005 08:09, Stuart Brorson wrote: > I have modified only the "modify -> move -> move horizontal" action > to work in my preferred way. > Note that I had to make one architectural change to make "select > first, then act" work for text objects: > Please find my patches attached here. The patch applied perfectly against the already patched 27th release. I had a play with it, and it works well. A couple of comments: 1. The 'classic PythonCAD way' (similar to AutoCAD if I remember) involves one less menu pull-down operation: the 'select' mode is entered into automatically (once the move distance has been defined). This could be achieved with Stuart's method if PythonCAD defaulted to 'select' mode if idle: draw a box around objects, then go to MOVE->MODIFY->HORIZONTAL. Admittedly, the classic way is less inuitive to people used to drag & drop GUIs, and consistency in select, operation or operation, select is a good point. 2. I am wondering whether the architectural change mentioned above has missed something out. When I move a circle with a radial dimension in it, one side of the dim. line gets left behind. Wilbert. From sdb at cloud9.net Mon Dec 12 23:19:20 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Mon, 12 Dec 2005 17:19:20 -0500 (EST) Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <20051212193936.GF2481@artsapartment.org> from "Art Haas" at Dec 12, 2005 01:39:36 PM Message-ID: <20051212221920.510092AA07@earl-grey.cloud9.net> Art -- > The current move behavior, that is the distance specification prior to > the entity specification, was how I remember doing move operations > in ME-10. As you point out, this approach is inconsistent with other > PythonCAD operations, and in many cases the reverse procedure in how > other programs expect the user to modify the entities built and > controlled in that program. The internal PythonCAD inconsistency has > become more bothersome to me, and a note to fix things was added into > the TODO file included in the latest release. So, I definitely want to > make some changes so that PythonCAD is consistent and performing one > type of operation should at least give you a reasonable guess on the > steps needed to perform some other change. As I said in a different e-mail, I prefer the "first select, then act" behavior for driving a program. I realize that lots of programs don't behave this way. I think, however, that "select action, then select objects" is the older, obsolete behavior. The gold standard drawing program IMO is Visio. I find it simply great, despite being an MS product. (Of course, it's not an internally developed program, but rather something they bought.) Visio uses a strict "select then act" paradigm. YMMV, of course. > > Note that I had to make one architectural change to make "select > > first, then act" work for text objects: I had to make TextBlock a > > subclass of GraphicObject (it was subclassed to Entity). Without this > > change, text wouldn't move using > > PythonCAD.Generic.move.move_objects(). Now moving text works, but I > > get lots warning spew when the program is run and addStyle is called. > > The program seems to work anyway. The warning spew occurs because > > _layerAddedChild tries to setStyle or getStyle on the > > text. Maybe I need to add a Style parameter to TextBlock? Or make > > the conditional (isinstance(_obj, GraphicObject)) return true for > > text by defining a different type of class which can be moved? In any > > event, if you don't like my changes, I didn't want to get too far > > ahead in cleaning up this issue. > > I don't like the change to the TextBlock class, because making that > class be a subclass of GraphicObject implies that at TextBlock needs > the style, linetype, and thickness attributes that a GraphicObject > instance utilizes. A peek at move_objects() suggests that there > should not be any changes needed to handle moving TextBlocks, so I'm not > sure why the change was necessary. After I dig into things a little > deeper maybe I'll achieve enlightenment. That's fine. I found that without this change, the bits of text annotation I had placed in my drawings weren't moving. Maybe there's a better way. . . . > > I'm going to make the change to the horizontal moving to behave as your > patch would have it, and I'll use some of your changes as a starting > point. I suspect that I'll tweak some of your changes a bit, so what > I'll do is send out some diffs when things look like I think they > should, then we can see how things looks. > > > 2. Next change: Added stuff to Entry, TreeView, and > > window_general_event to try to make entry box behave as I want, but > > also pass arrow keys to the TreeView, which is what you want. That > > is, I want to type numbers into the Entry widget at the bottom of the > > window when asked for numerical input (e.g. when making a move). My > > changes seem to work, but you must sometimes > > first select the LayerDisplay area with the mouse. That is, when the > > Entry box has the focus, it doesn't let any arrow keys past it to get > > to the TreeView. I can look at that more, but first wanted to gague > > your interest in this change. > > I'll look at this stuff after playing with the move changes. Again, I > definitely want making numerical input from the keyboard work when the > focus is in the layer display, as the unexpected appearance of the entry > box is, well, unexpected. I'll wait for a day or two and then do an "svn update". After that I can implement the "select first then act" behavior everywhere -- with your blessing, of course. Stuart From sdb at cloud9.net Mon Dec 12 23:12:17 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Mon, 12 Dec 2005 17:12:17 -0500 (EST) Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <200512130933.03365.w.knol@niwa.co.nz> from "Wilbert Knol" at Dec 13, 2005 09:33:02 AM Message-ID: <20051212221217.881F22AA07@earl-grey.cloud9.net> Wilbert -- > On Saturday 10 December 2005 08:09, Stuart Brorson wrote: > > > I have modified only the "modify -> move -> move horizontal" action > > to work in my preferred way. > > > Note that I had to make one architectural change to make "select > > first, then act" work for text objects: > > > Please find my patches attached here. > > The patch applied perfectly against the already patched 27th release. > I had a play with it, and it works well. A couple of comments: > > 1. The 'classic PythonCAD way' (similar to AutoCAD if I remember) > involves one less menu pull-down operation: the 'select' mode is > entered into automatically (once the move distance has been defined). > > This could be achieved with Stuart's method if PythonCAD defaulted to > 'select' mode if idle: draw a box around objects, then go to > MOVE->MODIFY->HORIZONTAL. This would be easy to do. Art, are you interested in this type of behavior? If so, I would be happy to implement this. Just lemme know! > Admittedly, the classic way is less inuitive to people used to drag & > drop GUIs, and consistency in select, operation or operation, select > is a good point. Although I am not a mechanical CAD expert, I can say that I don't know of any real CAD program with a Windoze-like point-and-drool interface. Due to teh complex nature of the data being handled, the ones I am aware of require a little more mouse clicking and key pressing than most office-level programs. That being said, I prefer CAD programs which operate using a strict "first select, then act" paradigm. The gEDA project's gschem works like this, and once you get used to it (after 15 minutes), you can enter schematics at lightening speed. > 2. I am wondering whether the architectural change mentioned above has > missed something out. When I move a circle with a radial dimension in > it, one side of the dim. line gets left behind. I noticed similar behavior with dimensions. They are apparently not GraphicObjects. I need to investigate PythonCAD's internal workings more, and/or Art can explain how dimensions work. Stuart From ahaas at airmail.net Mon Dec 12 23:33:42 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 12 Dec 2005 16:33:42 -0600 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <20051212193936.GF2481@artsapartment.org> References: <20051207164516.GO2481@artsapartment.org> <200512081005.05449.w.knol@niwa.co.nz> <20051208224213.GW2481@artsapartment.org> <200512091341.37105.w.knol@niwa.co.nz> <20051209011648.GX2481@artsapartment.org> <20051209140901.z91dgnvtsk0gso4g@www.mail.cloud9.net> <20051212193936.GF2481@artsapartment.org> Message-ID: <20051212223342.GI2481@artsapartment.org> On Mon, Dec 12, 2005 at 01:39:36PM -0600, Art Haas wrote: > > I'm going to make the change to the horizontal moving to behave as your > patch would have it, and I'll use some of your changes as a starting > point. I suspect that I'll tweak some of your changes a bit, so what > I'll do is send out some diffs when things look like I think they > should, then we can see how things looks. I took the patch Stuart provided and after tweaking things for a while I've produced the following diff. First, I've changed the 'gtkmenus.py' file so that move operations are only available if something is selected. Second, I've slightly simplified Stuart's code, and made changes so that horizontal, vertical, and two-point moves are all changed. The patch below is not committed to my repo, btw. Art Index: PythonCAD/Interface/Gtk/gtkmenus.py =================================================================== --- PythonCAD/Interface/Gtk/gtkmenus.py (revision 2089) +++ PythonCAD/Interface/Gtk/gtkmenus.py (working copy) @@ -1877,7 +1877,7 @@ _active = gtkimage.getActiveLayer() _act = _group.get_action('Move') if _act is not None: - _act.set_property('sensitive', _active.hasEntities()) + _act.set_property('sensitive', gtkimage.hasSelection()) _act = _group.get_action('Stretch') if _act is not None: _act.set_property('sensitive', _active.hasEntities()) Index: PythonCAD/Interface/Gtk/gtkmodify.py =================================================================== --- PythonCAD/Interface/Gtk/gtkmodify.py (revision 2089) +++ PythonCAD/Interface/Gtk/gtkmodify.py (working copy) @@ -147,9 +147,12 @@ if len(_text): _dist = util.get_float(eval(_text, gtkimage.getImageVariables())) tool.setDistance(_dist, 0.0) - gtkimage.setPrompt("Click on the objects to move.") - tool.setHandler("button_press", move_elem_button_press_cb) - tool.delHandler("entry_event") + _active_layer = gtkimage.getActiveLayer() + _objs = [] + for _obj in gtkimage.getSelectedObjects(): + if _obj.getParent() is _active_layer: + _objs.append(_obj) + move_objects(gtkimage, _objs, tool) def move_horizontal_second_button_press_cb(gtkimage, widget, event, tool): _x, _y = gtkimage.getCurrentPoint() @@ -161,10 +164,12 @@ _x, _y = _pc _x1, _y1 = tool.getLocation() tool.setDistance((_x - _x1), 0.0) - tool.clearLocation() - gtkimage.setPrompt("Select the objects to move.") - tool.setHandler("button_press", move_elem_button_press_cb) - tool.delHandler("entry_event") + _active_layer = gtkimage.getActiveLayer() + _objs = [] + for _obj in gtkimage.getSelectedObjects(): + if _obj.getParent() is _active_layer: + _objs.append(_obj) + move_objects(gtkimage, _objs, tool) return True def move_horizontal_first_button_press_cb(gtkimage, widget, event, tool): @@ -196,9 +201,12 @@ if len(_text): _dist = util.get_float(eval(_text, gtkimage.getImageVariables())) tool.setDistance(0.0, _dist) - gtkimage.setPrompt("Click on the objects to move.") - tool.setHandler("button_press", move_elem_button_press_cb) - tool.delHandler("entry_event") + _active_layer = gtkimage.getActiveLayer() + _objs = [] + for _obj in gtkimage.getSelectedObjects(): + if _obj.getParent() is _active_layer: + _objs.append(_obj) + move_objects(gtkimage, _objs, tool) def move_vertical_second_button_press_cb(gtkimage, widget, event, tool): _x, _y = gtkimage.getCurrentPoint() @@ -210,10 +218,12 @@ _x, _y = _pc _x1, _y1 = tool.getLocation() tool.setDistance(0.0, (_y - _y1)) - tool.clearLocation() - gtkimage.setPrompt("Select the objects to move.") - tool.setHandler("button_press", move_elem_button_press_cb) - tool.delHandler("entry_event") + _active_layer = gtkimage.getActiveLayer() + _objs = [] + for _obj in gtkimage.getSelectedObjects(): + if _obj.getParent() is _active_layer: + _objs.append(_obj) + move_objects(gtkimage, _objs, tool) return True def move_vertical_first_button_press_cb(gtkimage, widget, event, tool): @@ -245,9 +255,12 @@ if len(_text): _x, _y = eval(_text, gtkimage.getImageVariables()) tool.setDistance(util.get_float(_x), util.get_float(_y)) - gtkimage.setPrompt("Click on the objects to move.") - tool.setHandler("button_press", move_elem_button_press_cb) - tool.delHandler("entry_event") + _active_layer = gtkimage.getActiveLayer() + _objs = [] + for _obj in gtkimage.getSelectedObjects(): + if _obj.getParent() is _active_layer: + _objs.append(_obj) + move_objects(gtkimage, _objs, tool) def move_xy_second_button_press_cb(gtkimage, widget, event, tool): _x, _y = gtkimage.getCurrentPoint() @@ -259,10 +272,12 @@ _x, _y = _pc _x1, _y1 = tool.getLocation() tool.setDistance((_x - _x1), (_y - _y1)) - tool.clearLocation() - gtkimage.setPrompt("Select the objects to move.") - tool.setHandler("button_press", move_elem_button_press_cb) - tool.delHandler("entry_event") + _active_layer = gtkimage.getActiveLayer() + _objs = [] + for _obj in gtkimage.getSelectedObjects(): + if _obj.getParent() is _active_layer: + _objs.append(_obj) + move_objects(gtkimage, _objs, tool) return True def move_xy_first_button_press_cb(gtkimage, widget, event, tool): -- 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 From ahaas at airmail.net Mon Dec 12 23:46:45 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 12 Dec 2005 16:46:45 -0600 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <20051212221920.510092AA07@earl-grey.cloud9.net> References: <20051212193936.GF2481@artsapartment.org> <20051212221920.510092AA07@earl-grey.cloud9.net> Message-ID: <20051212224645.GJ2481@artsapartment.org> On Mon, Dec 12, 2005 at 05:19:20PM -0500, Stuart Brorson wrote: > Art -- > > > The current move behavior, that is the distance specification prior to > > the entity specification, was how I remember doing move operations > > in ME-10. As you point out, this approach is inconsistent with other > > PythonCAD operations, and in many cases the reverse procedure in how > > other programs expect the user to modify the entities built and > > controlled in that program. The internal PythonCAD inconsistency has > > become more bothersome to me, and a note to fix things was added into > > the TODO file included in the latest release. So, I definitely want to > > make some changes so that PythonCAD is consistent and performing one > > type of operation should at least give you a reasonable guess on the > > steps needed to perform some other change. > > As I said in a different e-mail, I prefer the "first select, then act" > behavior for driving a program. I realize that lots of programs don't > behave this way. I think, however, that "select action, then select > objects" is the older, obsolete behavior. > > The gold standard drawing program IMO is Visio. I find it simply > great, despite being an MS product. (Of course, it's not an > internally developed program, but rather something they bought.) > Visio uses a strict "select then act" paradigm. > > YMMV, of course. I've never used Visio, so I'm not familiar with how it works. As for CAD software, I haven't used AutoCAD in years, and my ME-10 work stopped around 1998, so I don't know what the current program does, or for that matter if it is still around. > > > Note that I had to make one architectural change to make "select > > > first, then act" work for text objects: I had to make TextBlock a > > > subclass of GraphicObject (it was subclassed to Entity). Without this > > > change, text wouldn't move using > > > PythonCAD.Generic.move.move_objects(). Now moving text works, but I > > > get lots warning spew when the program is run and addStyle is called. > > > The program seems to work anyway. The warning spew occurs because > > > _layerAddedChild tries to setStyle or getStyle on the > > > text. Maybe I need to add a Style parameter to TextBlock? Or make > > > the conditional (isinstance(_obj, GraphicObject)) return true for > > > text by defining a different type of class which can be moved? In any > > > event, if you don't like my changes, I didn't want to get too far > > > ahead in cleaning up this issue. > > > > I don't like the change to the TextBlock class, because making that > > class be a subclass of GraphicObject implies that at TextBlock needs > > the style, linetype, and thickness attributes that a GraphicObject > > instance utilizes. A peek at move_objects() suggests that there > > should not be any changes needed to handle moving TextBlocks, so I'm not > > sure why the change was necessary. After I dig into things a little > > deeper maybe I'll achieve enlightenment. > > That's fine. I found that without this change, the bits of text > annotation I had placed in my drawings weren't moving. Maybe there's > a better way. . . . In the patch I posted I didn't make any changes to the TextBlock code and I was able to move TextBlock instances without error. > > I'm going to make the change to the horizontal moving to behave as your > > patch would have it, and I'll use some of your changes as a starting > > point. I suspect that I'll tweak some of your changes a bit, so what > > I'll do is send out some diffs when things look like I think they > > should, then we can see how things looks. > > > > > 2. Next change: Added stuff to Entry, TreeView, and > > > window_general_event to try to make entry box behave as I want, but > > > also pass arrow keys to the TreeView, which is what you want. That > > > is, I want to type numbers into the Entry widget at the bottom of the > > > window when asked for numerical input (e.g. when making a move). My > > > changes seem to work, but you must sometimes > > > first select the LayerDisplay area with the mouse. That is, when the > > > Entry box has the focus, it doesn't let any arrow keys past it to get > > > to the TreeView. I can look at that more, but first wanted to gague > > > your interest in this change. > > > > I'll look at this stuff after playing with the move changes. Again, I > > definitely want making numerical input from the keyboard work when the > > focus is in the layer display, as the unexpected appearance of the entry > > box is, well, unexpected. > > I'll wait for a day or two and then do an "svn update". After that I > can implement the "select first then act" behavior everywhere -- with > your blessing, of course. Let me know what you think of the patch I posted for implementing selection first moving. A coding plus of using this approach is the need for a motion-notify handler after the first button press is removed because there is no need to try and draw a box for selecting entities. Art -- 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 From ahaas at airmail.net Tue Dec 13 17:59:37 2005 From: ahaas at airmail.net (Art Haas) Date: Tue, 13 Dec 2005 10:59:37 -0600 Subject: [PythonCAD] Consistency in operations in PythonCAD Message-ID: <20051213165937.GL2481@artsapartment.org> Hi. The recent discussion and patches regarding changing move operations to require first selecting the entities and then specifying the displacement(s) warrants more discussion. For move operations, I think that the proposed changes are worthwhile, 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? How about other operations like entity stretching or splitting? Here's some more background on why I'd implemented things as they are. When I used ME-10 at my job, I was doing finite element analysis, and I would draw the element meshes in ME-10 instead of using some type of auto-meshing procedure available in the FEA package we used (Ansys). So, given some part to analyze, I'd sit and draw segments over the outline of the shape, sometimes selecting a large number of segments and then splitting them at their intersection points, other times drawing the individual elements one at a time. After I had the basic shape complete, I'd go and move some of the points around to make the elements look more uniform, as well as making the four-sided elements as square as possible so the results would be better. ME-10 had a nice interactive mode of moving points where you would click on the point, and then as you moved your mouse/digitizer to where you pleased all the segments that used that point would be redrawn as the point moved. Eventually I'd like PythonCAD to do this as well. Still, this point movement was performed by starting the 'move' operation, and then selecting what to move, and I found this procedure very easy and quick to use. So much so that generating decent FEA meshes was much, much faster than the attempts to use Ansys auto-meshing, something that I did try every now and then. Many (most?) of ME-10 edit type operations were performed by starting the operation first, then selecting the entities on which the action will be applied. Changing entity color, thickness, and linetypes were all done this way, as was changing the various attributes of complex entities like hatching and dimensions. It is due to my years of working with ME-10 in this manner that I'd written PythonCAD to behave in a similar fashion. As for PythonCAD's editing functions other than moving, such as entity splitting, I know that I want to keep the ability to click on an object in a drawing and have it split without first having to select it. Also, splitting numerous entities at intersections by invoking 'split' and then drawing a box around the desired entities requires fewer mouse clicks than selecting first and then invoking 'split'. Expanding on this, in addition to making PythonCAD possibly behave like other CAD packages in regards to editing, we need to consider making the actions as simple to perform as possible. By reducing the number of mouse clicks or commands needed to perform some action we can achieve this, though potentially at the price of program behavior differing than what is initially expected. I do want to make things easy for people to transition to using PythonCAD, but I don't want to be constrained in emulating tedious behavior in other programs. Please feel free to add comments about this, and also send in some reports about how other CAD packages handle operations like moving, splitting, mirroring, and changing the attributes of entities in a drawing. Art -- 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 From 5ko at free.fr Tue Dec 13 18:33:38 2005 From: 5ko at free.fr (Petko Yotov) Date: Tue, 13 Dec 2005 18:33:38 +0100 Subject: [PythonCAD] Consistency in operations in PythonCAD In-Reply-To: <20051213165937.GL2481@artsapartment.org> References: <20051213165937.GL2481@artsapartment.org> Message-ID: <200512131833.39031.5ko@free.fr> Hello, Art, On Autocad and Intellicad ou can perform the action both ways: either first chosing an action (ex. move) and then the program asks to select objects, then select vector or 2 points; or first selecting objects and then chosing the action (keyboard or menu), then the program asks to select the vector. Stretching/moving is quite easy as an object can be selected and a "grip" on a corner (for stretching) or in the middle (for moving) can be dragged with the mouse. When the drag operation starts, you can chose 2 points or a vector just like the "select-action" mode. There is an alpha IntelliCAD edition for Linux/Wine that you may test. IntelliCAD is almost an AutoCAD clone and behaves similarly. Two editors currently, I tested the first one. http://www.progesoft.com/ http://www.bricscad.com/ Greetings, Petko On Tuesday 13 December 2005 17:59, Art Haas wrote: > Hi. > > The recent discussion and patches regarding changing move operations to > require first selecting the entities and then specifying the > displacement(s) warrants more discussion. For move operations, I think > that the proposed changes are worthwhile, 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? How about other operations like entity > stretching or splitting? From pachi at mmn-arquitectos.com Tue Dec 13 18:37:27 2005 From: pachi at mmn-arquitectos.com (Rafael Villar Burke) Date: Tue, 13 Dec 2005 18:37:27 +0100 Subject: [PythonCAD] Consistency in operations in PythonCAD In-Reply-To: <20051213165937.GL2481@artsapartment.org> References: <20051213165937.GL2481@artsapartment.org> Message-ID: <439F06D7.30208@mmn-arquitectos.com> Art Haas wrote: >Hi. > >The recent discussion and patches regarding changing move operations to >require first selecting the entities and then specifying the >displacement(s) warrants more discussion. For move operations, I think >that the proposed changes are worthwhile, 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? How about other operations like entity >stretching or splitting? > > AutoCAD lets you set an option to allow using noun/verb selection (select and later tell what to do) instead of verb/noun selection. I personally have that selection set all the time, as all people here in the practice, and most architects I know. This is what the AutoCAD help says about it: ---------------- Noun/Verb Selection Selects an object before invoking a command. The invoked command affects the previously selected object or objects. You can also set this option by using the PICKFIRST system variable. You can use many editing and inquiry commands with noun/verb selection, including ALIGN DVIEW PROPERTIES ARRAY ERASE ROTATE BLOCK EXPLODE SCALE CHANGE LIST STRETCH CHPROP MIRROR WBLOCK COPY MOVE -------------------- I find it very useful when you need to select a big number of elements and they are scattered around the drawing or you need to select and unselect a lot of them and you won't repeat the operation (you unselect some objects by pressing shift and using any of the selection methods). Noun/verb selection is also useful when you want to left-click later on the selection to use a context menu that displays less used commands or those that you don't usually remember their accelerators or key bindings, such as the display properties panel, filtered selection, xref manager... On the other hand, when I need to use the same command many times, I tend to minimize mouse clicks using right click with no selected entities, so as to the last command gets repeated and I can thereafter choose which entities need to be modified. Another nice feature is that you can select a group of objects just to keep that selection in a "selection buffer", so you first select them, later you change layer visibility, zoom factor or any other viewing options or actions that don't need entity selection, and after you can get back the previous selection when running a command (using p, for previous, when you're asked to select some objects). This seems a bit convoluted, but you can isolate some layers to have less visible entities, select some of them amongst the visible ones, later turn on the visibility of all layers and, for instance, move them using two origin and destination reference points from a previously invisible layer. The selection capabilities are not very well thought/exploited in AutoCAD vs., for instance, 3DMax, where you can have named selections that you are able to redefine easily. Probably the best thing would be having an internal list of selected objects and use it to decide, when a command is executed, whether noun/verb or normal selection must be used depending on the emptiness of that list. Wise use of named selections would avoid having to create a lot of layers merely for drawing convenience. >Please feel free to add comments about this, and also send in some >reports about how other CAD packages handle operations like moving, >splitting, mirroring, and changing the attributes of entities in >a drawing. > >Art > > Hope this comments help and keep the great work, Rafael Villar Burke From Neuman at fastwebnet.it Tue Dec 13 21:08:59 2005 From: Neuman at fastwebnet.it (Neuman) Date: Tue, 13 Dec 2005 20:08:59 +0000 Subject: [PythonCAD] problem to launch PythonCAD In-Reply-To: <20051212022955.GB2481@artsapartment.org> References: <200512102252.24107.Neuman@fastwebnet.it> <20051212022955.GB2481@artsapartment.org> Message-ID: <200512132008.59451.Neuman@fastwebnet.it> On Monday 12 December 2005 02:29 am, Art Haas wrote: > On Sat, Dec 10, 2005 at 10:52:23PM +0000, Neuman wrote: > > Hi all, > > > > I'm quite new with Linux and Python (so please be tolerant with my > > noobie's questions), I was searching a CAD program released under GPL and > > PythonCAD seems to fit my needs but I have have encountered some > > problem.... > > > > I have installed the program on my desktop , but when I try to launch it > > with "gtkpycad.py" it tell me: > > > > Traceback (most recent call last): > > File "/usr/local/bin/gtkpycad.py", line 30, in ? > > import pygtk > > ImportError: No module named pygtk > > > > Well, I checked if my pygtk was correctly installed, I launched the > > command "rpm -qa | grep pygtk" and it gives me the following output: > > > > pygtk2.0-libglade-2.3.96-1mdk > > pygtk2.0-wrapper-2.3.96-1mdk > > pygtk2.0-2.3.96-1mdk > > > > So, the pygkt is correctly installed but python cannot view it. > > What is wrong about it? > > > > I use Python 2.4.1, Mandrake Linux 10.1. > > > > Thanks to all > > Hi. > > I don't have a Mandrake machine to test with, so based on what the > listed pygtk package you have installed I would have guessed PythonCAD > should have started. What you may want to try is installing a '-devel' > package for pygtk, as maybe that package has some of the libraries or > files needed for pygtk apps to run, but this suggestion is only a guess. > > What happens when you manually start python and try to import the > 'pygtk' module ... > > $ python > > >>> import pygtk > > Does that work? > > Art Haas Hi Art, thanks for your answer, I tried to import pygtk after manually started python as you suggested, the output it gives me is: Traceback (most recent call last): File "", line 1, in ? ImportError: No module named pygtk So I think the problem is not pythonCAD itself but that python cannot view pygtk library, I'll try to solve this by myself or asking to python community. I hope I can have pythonCAD running on my machine soon to use it and possibly to contribute as final user. Thanks again, Bye Dario From ahaas at airmail.net Tue Dec 13 20:24:37 2005 From: ahaas at airmail.net (Art Haas) Date: Tue, 13 Dec 2005 13:24:37 -0600 Subject: [PythonCAD] problem to launch PythonCAD In-Reply-To: <200512132008.59451.Neuman@fastwebnet.it> References: <200512102252.24107.Neuman@fastwebnet.it> <20051212022955.GB2481@artsapartment.org> <200512132008.59451.Neuman@fastwebnet.it> Message-ID: <20051213192437.GN2481@artsapartment.org> On Tue, Dec 13, 2005 at 08:08:59PM +0000, Neuman wrote: > On Monday 12 December 2005 02:29 am, Art Haas wrote: > > On Sat, Dec 10, 2005 at 10:52:23PM +0000, Neuman wrote: > > > Hi all, > > > > > > I'm quite new with Linux and Python (so please be tolerant with my > > > noobie's questions), I was searching a CAD program released under GPL and > > > PythonCAD seems to fit my needs but I have have encountered some > > > problem.... > > > > > > I have installed the program on my desktop , but when I try to launch it > > > with "gtkpycad.py" it tell me: > > > > > > Traceback (most recent call last): > > > File "/usr/local/bin/gtkpycad.py", line 30, in ? > > > import pygtk > > > ImportError: No module named pygtk > > > > > > Well, I checked if my pygtk was correctly installed, I launched the > > > command "rpm -qa | grep pygtk" and it gives me the following output: > > > > > > pygtk2.0-libglade-2.3.96-1mdk > > > pygtk2.0-wrapper-2.3.96-1mdk > > > pygtk2.0-2.3.96-1mdk > > > > > > So, the pygkt is correctly installed but python cannot view it. > > > What is wrong about it? > > > > > > I use Python 2.4.1, Mandrake Linux 10.1. > > > > > > Thanks to all > > > > Hi. > > > > I don't have a Mandrake machine to test with, so based on what the > > listed pygtk package you have installed I would have guessed PythonCAD > > should have started. What you may want to try is installing a '-devel' > > package for pygtk, as maybe that package has some of the libraries or > > files needed for pygtk apps to run, but this suggestion is only a guess. > > > > What happens when you manually start python and try to import the > > 'pygtk' module ... > > > > $ python > > > > >>> import pygtk > > > > Does that work? > > > > Art Haas > > > Hi Art, > thanks for your answer, > > I tried to import pygtk after manually started python as you suggested, the > output it gives me is: > > Traceback (most recent call last): > File "", line 1, in ? > ImportError: No module named pygtk > > So I think the problem is not pythonCAD itself but that python cannot view > pygtk library, I'll try to solve this by myself or asking to python > community. Is it possible that you have other python binaries installed on your machine? Perhaps when you type 'python' at the prompt the "wrong" one is executed instead of the system provided binary which is probably in the '/usr/bin' directory. > I hope I can have pythonCAD running on my machine soon to use it and > possibly to contribute as final user. That would be great. Good luck getting the python problem resolved. 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 From w.knol at niwa.co.nz Wed Dec 14 07:04:57 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Wed, 14 Dec 2005 19:04:57 +1300 Subject: [PythonCAD] Consistency in operations in PythonCAD In-Reply-To: <20051213165937.GL2481@artsapartment.org> References: <20051213165937.GL2481@artsapartment.org> Message-ID: <200512141904.57953.w.knol@niwa.co.nz> > 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. 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. Wilbert. > How about other operations like entity > stretching or splitting? > > Here's some more background on why I'd implemented things as they are. > When I used ME-10 at my job, I was doing finite element analysis, and I > would draw the element meshes in ME-10 instead of using some type of > auto-meshing procedure available in the FEA package we used (Ansys). So, > given some part to analyze, I'd sit and draw segments over the outline > of the shape, sometimes selecting a large number of segments and then > splitting them at their intersection points, other times drawing the > individual elements one at a time. After I had the basic shape complete, > I'd go and move some of the points around to make the elements look more > uniform, as well as making the four-sided elements as square as possible > so the results would be better. ME-10 had a nice interactive mode of > moving points where you would click on the point, and then as you moved > your mouse/digitizer to where you pleased all the segments that used > that point would be redrawn as the point moved. Eventually I'd like > PythonCAD to do this as well. Still, this point movement was performed > by starting the 'move' operation, and then selecting what to move, and > I found this procedure very easy and quick to use. So much so that > generating decent FEA meshes was much, much faster than the attempts to > use Ansys auto-meshing, something that I did try every now and then. > > Many (most?) of ME-10 edit type operations were performed by starting > the operation first, then selecting the entities on which the action > will be applied. Changing entity color, thickness, and linetypes were > all done this way, as was changing the various attributes of complex > entities like hatching and dimensions. It is due to my years of working > with ME-10 in this manner that I'd written PythonCAD to behave in a > similar fashion. > > As for PythonCAD's editing functions other than moving, such as entity > splitting, I know that I want to keep the ability to click on an object > in a drawing and have it split without first having to select it. Also, > splitting numerous entities at intersections by invoking 'split' and > then drawing a box around the desired entities requires fewer mouse > clicks than selecting first and then invoking 'split'. Expanding on > this, in addition to making PythonCAD possibly behave like other CAD > packages in regards to editing, we need to consider making the actions > as simple to perform as possible. By reducing the number of mouse clicks > or commands needed to perform some action we can achieve this, though > potentially at the price of program behavior differing than what is > initially expected. I do want to make things easy for people to transition > to using PythonCAD, but I don't want to be constrained in emulating > tedious behavior in other programs. > > Please feel free to add comments about this, and also send in some > reports about how other CAD packages handle operations like moving, > splitting, mirroring, and changing the attributes of entities in > a drawing. > > Art From sdb at cloud9.net Wed Dec 14 13:28:04 2005 From: sdb at cloud9.net (Stuart Brorson) Date: Wed, 14 Dec 2005 07:28:04 -0500 (EST) Subject: [PythonCAD] Consistency in operations in PythonCAD In-Reply-To: <200512141904.57953.w.knol@niwa.co.nz> from "Wilbert Knol" at Dec 14, 2005 07:04:57 PM Message-ID: <20051214122804.C0FBD2AA07@earl-grey.cloud9.net> 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 -hotkeys. Art has done a fine job with architecting the program so extensions like this are easy. > 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 . For example, to do a horizontal move, you do -e s ("edit", "select"), then click on the object to select. The selected object highlights. Then you press -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. Stuart From ahaas at airmail.net Wed Dec 14 17:57:33 2005 From: ahaas at airmail.net (Art Haas) Date: Wed, 14 Dec 2005 10:57:33 -0600 Subject: [PythonCAD] Consistency in operations in PythonCAD In-Reply-To: <20051214122804.C0FBD2AA07@earl-grey.cloud9.net> References: <200512141904.57953.w.knol@niwa.co.nz> <20051214122804.C0FBD2AA07@earl-grey.cloud9.net> Message-ID: <20051214165733.GQ2481@artsapartment.org> 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 -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 > . For example, to do a horizontal move, you do > -e s ("edit", "select"), then click on the object to select. > The selected object highlights. Then you press -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 From w.knol at niwa.co.nz Wed Dec 14 23:51:11 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Thu, 15 Dec 2005 11:51:11 +1300 Subject: [PythonCAD] Consistency in operations in PythonCAD In-Reply-To: <20051214122804.C0FBD2AA07@earl-grey.cloud9.net> References: <20051214122804.C0FBD2AA07@earl-grey.cloud9.net> Message-ID: <200512151151.11103.w.knol@niwa.co.nz> > > 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 . I was wondering if it would be possible to leave out the 'alt' for often-used operations. As an example: at present, to zoom in, I need to press 'alt-m' and then 'z'., repeatedly. In pcb and gschem I can do this by just hammering 'z' a few times to zoom up to the right level. Perhaps it makes sense to make these shortcut key bindings only for items that are in the context menu. Wilbert. From ahaas at airmail.net Thu Dec 15 18:15:09 2005 From: ahaas at airmail.net (Art Haas) Date: Thu, 15 Dec 2005 11:15:09 -0600 Subject: [PythonCAD] Consistency in operations in PythonCAD In-Reply-To: <200512151151.11103.w.knol@niwa.co.nz> References: <20051214122804.C0FBD2AA07@earl-grey.cloud9.net> <200512151151.11103.w.knol@niwa.co.nz> Message-ID: <20051215171509.GY2481@artsapartment.org> On Thu, Dec 15, 2005 at 11:51:11AM +1300, Wilbert Knol wrote: > > > > 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 . > > I was wondering if it would be possible to leave out the 'alt' for > often-used operations. As an example: at present, to zoom in, I need > to press 'alt-m' and then 'z'., repeatedly. > > In pcb and gschem I can do this by just hammering 'z' a few times to > zoom up to the right level. > > Perhaps it makes sense to make these shortcut key bindings only for > items that are in the context menu. Adding in handlers like what you're asking for is not impossible, it is just a matter of adjusting the 'key_press' event handling code. Right now, when you press a key like 'z', and the keyboard focus is in the DrawingArea, the handler changes the focus to the entry widget at the bottom of the screen and you'll see a 'z' typed there. If the keyboard focus is on the layer display, an unexpected entry box pops up with your 'z'. This entry box is part of the TreeView widget and lets you select one of the items displayed in the TreeView by typing in the name, but if you are not expecting the box to appear it is confusing. One problem I see with adding handlers like you describe would be you want to type an expression like 'a = 10' but there is a handler invoked when 'a' is typed, so the handler is called instead of you typing the expression on the entry box. Do pcb and/or gschem have some sort of entry widget where you can type commands? Art -- 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 From w.knol at niwa.co.nz Thu Dec 15 20:09:34 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Fri, 16 Dec 2005 08:09:34 +1300 Subject: [PythonCAD] Consistency in operations in PythonCAD In-Reply-To: <20051215171509.GY2481@artsapartment.org> References: <20051214122804.C0FBD2AA07@earl-grey.cloud9.net> <200512151151.11103.w.knol@niwa.co.nz> <20051215171509.GY2481@artsapartment.org> Message-ID: <200512160809.35142.w.knol@niwa.co.nz> > Do pcb and/or gschem have > some sort of entry widget where you can type commands? They don't - so I guess that's why they get away with the global key bindings. It is just that it is such a nice feature...keep your right hand on the mouse and quickly zoom up with the left hand by hitting 'z' repeatedly. I have not yet used the pythonCAD command line, but I can see it may not be possible to have both features. > > Art Something else - a bit off-topic : I have just updated with svn: [wk at wk pythoncad]$ svn update U PythonCAD/Interface/Gtk/gtkentities.py C PythonCAD/Interface/Gtk/gtkmenus.py U PythonCAD/Interface/Gtk/gtkmirror.py U PythonCAD/Generic/tools.py U PythonCAD/Generic/mirror.py U PythonCAD/Generic/leader.py C PythonCAD/Generic/graphicobject.py Updated to revision 2102. [wk at wk pythoncad]$ ... and pythoncad no longer runs: (best viewed with line wrap turned off) [wk at wk pythoncad]$ ./gtkpycad.py Traceback (most recent call last): File "./gtkpycad.py", line 35, in ? from PythonCAD.Generic import imageio File "/home/wk/.subversion/pythoncad/PythonCAD/Generic/imageio.py", line 36, in ? File "/home/wk/.subversion/pythoncad/PythonCAD/Generic/layer.py", line 31, in ? File "/home/wk/.subversion/pythoncad/PythonCAD/Generic/segment.py", line 30, in ? File "/home/wk/pythoncad/PythonCAD/Generic/graphicobject.py", line 245 <<<<<<< .mine ^ IndentationError: expected an indented block [wk at wk pythoncad]$ -- I did apply Stuart's patch a few days ago, so perhaps I should do a clean install first. Wilbert. From w.knol at niwa.co.nz Thu Dec 15 21:10:20 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Fri, 16 Dec 2005 09:10:20 +1300 Subject: [PythonCAD] Consistency in operations in PythonCAD In-Reply-To: <20051215194611.GZ2481@artsapartment.org> References: <20051214122804.C0FBD2AA07@earl-grey.cloud9.net> <200512160809.35142.w.knol@niwa.co.nz> <20051215194611.GZ2481@artsapartment.org> Message-ID: <200512160910.20278.w.knol@niwa.co.nz> > If you don't want to try and merge the changes, the easiest thing > to do is use the 'svn revert' command. In your case you would ... > > $ svn revert PythonCAD/Generic/graphicobject.py > $ svn revert PythonCAD/Interface/Gtk/gtkmenus.py > > ... and things should be good to go. Done that. All is well now, thanks! I also ran 'svn resolved' to tidy up. Wilbert. From rosell81 at yahoo.com Thu Dec 15 21:53:26 2005 From: rosell81 at yahoo.com (MARCOS ROSELL) Date: Thu, 15 Dec 2005 12:53:26 -0800 (PST) Subject: [PythonCAD] PythonCAD Digest, Vol 32, Issue 10 In-Reply-To: Message-ID: <20051215205326.81720.qmail@web31107.mail.mud.yahoo.com> About shortcuts: First I want to say sorry for my inglish (I`m from Argentina and here we speack spanish) Autocad use a text menu window that all the people that I know take advantage of it. There you don?t have keiboard shortcuts, you have command sortcuts but ( here is the good part of it ) you don?t have to push enter to do the command. For example: You want to move an object: You just select the object and pres M (move) en then instead of the enter key, you push the key (also works with the key )and then you move the object. Using the key saves time and hand movements to. This kind of workin allows you to have a hand in the mouse and a hand in the keyboard and you dont have to move it from there. Thanks for listening and I hope this considerations could be useful Marcos Rosell rosell81 at yahoo.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From ahaas at airmail.net Fri Dec 16 18:04:49 2005 From: ahaas at airmail.net (Art Haas) Date: Fri, 16 Dec 2005 11:04:49 -0600 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <20051215153400.0DF062AA07@earl-grey.cloud9.net> References: <20051214173049.GR2481@artsapartment.org> <20051215153400.0DF062AA07@earl-grey.cloud9.net> Message-ID: <20051216170449.GB3088@artsapartment.org> On Thu, Dec 15, 2005 at 10:34:00AM -0500, Stuart Brorson wrote: > Art -- > > > > * Another poster on the pythoncad list suggested making "select" the > > > default state for the program. That is, when the program is in idle > > > mode you can select objects, rather than having to do "edit -> select" > > > first. I agree with the poster that this would make the program > > > easier to use. If you agree I can send along some patches for this > > > too. > > > > Let's wait a bit on this. I like the current discussion about how other > > programs behave, and it might end up that PythonCAD will offer both > > 'select then act' behavior as well as 'action then select'. Right now > > I'm leaning towards this as the program could then operate in whichever > > mode you are most comfortable. > > Allowing "act then select" along with "select then act" is easy: In > the init methods, just look to see if any items are selected. If there > are, then perform the action. If not, then ask the user to select the > objects upon which to act. I can implement this as soon as I sync up > again. I played with changing mirroring operations to work in both 'select then act' and 'act then select', and the changes I needed are just the small patch below. I've been changing the code in 'mirror.py' so it would take advantage of newer methods in various classes than what were available when the code was originally written, plus I cleaned it up a bit and fixed the lost ability to mirror construction circles while at it. The mirroring interface code is easy to adjust as it is very short. As the patch below indicates, the changes below are very small to make this operation have 'NOUN/VERB' and 'VERB/NOUN' abilities if I borrow the AutoCAD terminology. Let me get some feedback on this, as offering both modes of operation would be immensely helpful to people used to working in one mode or another. Changing other editing code will probably not be as simple as this, but I'd be happy to be proven wrong. Art Index: PythonCAD/Interface/Gtk/gtkmirror.py =================================================================== --- PythonCAD/Interface/Gtk/gtkmirror.py (revision 2102) +++ PythonCAD/Interface/Gtk/gtkmirror.py (working copy) @@ -116,10 +116,13 @@ if _active_layer in _objdict: for _obj, _pt in _objdict[_active_layer]: if isinstance(_obj, (HCLine, VCLine, ACLine, CLine)): - tool.setHandler("button_press", first_button_press_cb) tool.setMirrorLine(_obj) - gtkimage.setPrompt("Click on the objects to mirror.") break + if gtkimage.hasSelection(): + mirror_objects(gtkimage, tool, gtkimage.getSelectedObjects()) + else: + tool.setHandler("button_press", first_button_press_cb) + gtkimage.setPrompt("Click on the objects to mirror.") return True def mirror_mode_init(tool): -- 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 From Neuman at fastwebnet.it Sat Dec 17 01:11:29 2005 From: Neuman at fastwebnet.it (Neuman) Date: Sat, 17 Dec 2005 00:11:29 +0000 Subject: [PythonCAD] problem to launch PythonCAD In-Reply-To: <200512132008.59451.Neuman@fastwebnet.it> References: <200512102252.24107.Neuman@fastwebnet.it> <20051212022955.GB2481@artsapartment.org> <200512132008.59451.Neuman@fastwebnet.it> Message-ID: <200512170011.29499.Neuman@fastwebnet.it> Hi, Finally I have installed PythonCAD on my Mandrake Linux and it works well. Nice program! Now I'm going to play with it and try to learn more about it. Bye, Dario From w.knol at niwa.co.nz Sun Dec 18 02:53:28 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Sun, 18 Dec 2005 14:53:28 +1300 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <20051216170449.GB3088@artsapartment.org> References: <20051214173049.GR2481@artsapartment.org> <20051215153400.0DF062AA07@earl-grey.cloud9.net> <20051216170449.GB3088@artsapartment.org> Message-ID: <200512181453.28850.w.knol@niwa.co.nz> On Saturday 17 December 2005 06:04, Art Haas wrote: > I played with changing mirroring operations to work in both 'select > Let me get some feedback on this, as offering both modes of The 'mirror' option on the 'modify' menu is greyed out...both pre- and post patch, and even if I select an object. I must be missing something?! Wilbert. From ahaas at airmail.net Sun Dec 18 15:01:10 2005 From: ahaas at airmail.net (Art Haas) Date: Sun, 18 Dec 2005 08:01:10 -0600 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <200512181453.28850.w.knol@niwa.co.nz> References: <20051214173049.GR2481@artsapartment.org> <20051215153400.0DF062AA07@earl-grey.cloud9.net> <20051216170449.GB3088@artsapartment.org> <200512181453.28850.w.knol@niwa.co.nz> Message-ID: <20051218140110.GL3088@artsapartment.org> On Sun, Dec 18, 2005 at 02:53:28PM +1300, Wilbert Knol wrote: > On Saturday 17 December 2005 06:04, Art Haas wrote: > > > I played with changing mirroring operations to work in both 'select > > > Let me get some feedback on this, as offering both modes of > > The 'mirror' option on the 'modify' menu is greyed out...both pre- and > post patch, and even if I select an object. I must be missing > something?! You need to have objects to mirror, like segments and circles, and then a mirroring contruction line - horizontal, vertical, angled, or one defined with two points - for the mirroring operations. Draw a couple of contruction lines as well as some "real" entities and mirroring should be available. Art -- 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 From w.knol at niwa.co.nz Mon Dec 19 21:58:37 2005 From: w.knol at niwa.co.nz (Wilbert Knol) Date: Tue, 20 Dec 2005 09:58:37 +1300 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <20051216170449.GB3088@artsapartment.org> References: <20051214173049.GR2481@artsapartment.org> <20051215153400.0DF062AA07@earl-grey.cloud9.net> <20051216170449.GB3088@artsapartment.org> Message-ID: <200512200958.37557.w.knol@niwa.co.nz> On Saturday 17 December 2005 06:04, Art Haas wrote: > I played with changing mirroring operations to work in both 'select > then act' and 'act then select' > Let me get some feedback on this Great! A nice refinement. It works both ways - seamlessly. An observation: if the program were in 'select mode' when idle, then the 'select then act' way would be even quicker, but this may not be so easily coded. > Index: PythonCAD/Interface/Gtk/gtkmirror.py > =================================================================== > --- PythonCAD/Interface/Gtk/gtkmirror.py (revision 2102) > +++ PythonCAD/Interface/Gtk/gtkmirror.py (working copy) If I apply this (and other) patches, would that confuse future svn updates? Or should I reverse any patches before doing an 'svn update'? I've been doing the latter, but I see my program produces 'SDB Debug' on stdout. Perhaps the SDB code has been committed to repo. Another question: should I do: su -c "python setup.py install" following svn updates? Wilbert. From ahaas at airmail.net Mon Dec 19 22:42:21 2005 From: ahaas at airmail.net (Art Haas) Date: Mon, 19 Dec 2005 15:42:21 -0600 Subject: [PythonCAD] New patches to PythonCAD . . . . In-Reply-To: <200512200958.37557.w.knol@niwa.co.nz> References: <20051214173049.GR2481@artsapartment.org> <20051215153400.0DF062AA07@earl-grey.cloud9.net> <20051216170449.GB3088@artsapartment.org> <200512200958.37557.w.knol@niwa.co.nz> Message-ID: <20051219214221.GA2309@artsapartment.org> On Tue, Dec 20, 2005 at 09:58:37AM +1300, Wilbert Knol wrote: > On Saturday 17 December 2005 06:04, Art Haas wrote: > > > I played with changing mirroring operations to work in both 'select > > then act' and 'act then select' > > > Let me get some feedback on this > > Great! A nice refinement. It works both ways - seamlessly. > > An observation: if the program were in 'select mode' when idle, then > the 'select then act' way would be even quicker, but this may not be > so easily coded. I don't know. Some coding or patches might shed light on the level of difficulty as well as any performance or useability issues. > > Index: PythonCAD/Interface/Gtk/gtkmirror.py > > =================================================================== > > --- PythonCAD/Interface/Gtk/gtkmirror.py (revision 2102) > > +++ PythonCAD/Interface/Gtk/gtkmirror.py (working copy) > > If I apply this (and other) patches, would that confuse future svn > updates? The mirroring patches are checked in now, as well as a new patch that tries to make PythonCAD better handler key-press events when you are using a tool that accepts keyboard entry but the focus - the widget that will respond to the keyboard - is not the entry widget at the bottom of the screen. > Or should I reverse any patches before doing an 'svn update'? I've > been doing the latter, but I see my program produces 'SDB Debug' on > stdout. Perhaps the SDB code has been committed to repo. In some place the "SDB Debug" is in. The easiest thing to do if you want to check your repo is use 'svn status'. Any files that differ from what I've checked in will be printed out. As for reversing patches prior to 'svn update', it probably is not a bad idea as you'll avoid any merge issues. You can always reapply the patch after the update completes. > Another question: should I do: > su -c "python setup.py install" > following svn updates? That's up to you. You can always run PythonCAD by invoking the 'gtkpycad.py' script in your checked out copy of the repo, and the code in the repo will be used as Python's 'sys.path' variable typically starts looking for files from 'import' in your current directory. I'd suggest running PythonCAD in this manner if you want to use the latest stuff, that way the code in Python's installed 'site-packages' directory is untouched if the current code has problems. The installed version ends up being a fallback if the development code has problems. Art -- 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 From jantonio.martin at gmail.com Thu Dec 22 13:50:32 2005 From: jantonio.martin at gmail.com (=?ISO-8859-1?Q?Jos=E9_Antonio_Mart=EDn_Prieto?=) Date: Thu, 22 Dec 2005 13:50:32 +0100 Subject: [PythonCAD] Some problems... Message-ID: Hi, Trying to get familiar with PythonCAD, I've been drawing a simple ISO sheet (just to draw something) and I have many problems to draft such a simple drawing. I'm using autocad everyday, and the behavior of PythonCAD is being hard for me. Some examples: - Is there any way to introduce relative coordinates? In autocad this is done by typing a "@" before the coordinates. - Is there any way to copy an object from a base point to another point? If not, I think this could be easily implemented as a "move" operation but without deleting the object being moved. - When I draw a segment just over another one, do the two segments exist or are they merged? In the first case, how do I select only one of them? Regards, Jose Antonio -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythoncad/attachments/20051222/717c84e6/attachment.htm From pachi at mmn-arquitectos.com Thu Dec 22 15:01:31 2005 From: pachi at mmn-arquitectos.com (Rafael Villar Burke) Date: Thu, 22 Dec 2005 15:01:31 +0100 Subject: [PythonCAD] Some problems... and ideas In-Reply-To: References: Message-ID: <43AAB1BB.8020706@mmn-arquitectos.com> I'd appoint to some other ideas on top of Jose Antonio ones: Jos? Antonio Mart?n Prieto wrote: > Hi, > Trying to get familiar with PythonCAD, I've been drawing a simple ISO > sheet (just to draw something) and I have many problems to draft such > a simple drawing. I'm using autocad everyday, and the behavior of > PythonCAD is being hard for me. Some examples: > - Is there any way to introduce relative coordinates? In autocad this > is done by typing a "@" before the coordinates. Relative coordinates are really useful, and there's also a really rocking autotrack (polar tracking + object snap tracking) feature in AutoCAD that I use all the time: From the autocad help: """AutoTrack helps you draw objects at specific angles or in specific relationships to other objects. When you turn on AutoTrack, temporary alignment paths help you create objects at precise positions and angles.[...]""" """Use polar tracking to track the cursor along temporary alignment paths defined by polar angles relative to a command's From or To points. [...] If you turn on the 45-degree polar angle increment, AutoCAD displays an alignment path and tooltip when your cursor crosses the 0 or 45-degree angles. The alignment path and tooltip disappear when you move the cursor away from the angle. [...] You can use polar tracking to track along polar angle increments of 90-, 60-, 45-, 30-, 22.5-, 18-, 15-, 10-, and 5-degrees, or you can specify other angles.""" """Use object snap tracking to track along alignment paths that are based on object snap points. For example, you can select a point along a path based on an object endpoint or midpoint or an intersection between objects. [...] To use object snap tracking 1 Start a drawing command. (You can also use object snap tracking with editing commands, such as COPY or MOVE.) 2 Move the cursor over an object snap point to temporarily acquire it. Do not click the point; pause over the point briefly to acquire it. Acquired points display a small plus sign (+), and you can acquire more than one. After you acquire a point, horizontal, vertical, or polar alignment paths relative to the point are displayed as you move the cursor over their drawing paths.""" Once a polar direction is adquired you can enter a number, and a point in such direction, at the given distance is entered. This is extremely useful, really. With it you don't need ortho at all. > - Is there any way to copy an object from a base point to another > point? If not, I think this could be easily implemented as a "move" > operation but without deleting the object being moved. > - When I draw a segment just over another one, do the two segments > exist or are they merged? In the first case, how do I select only one > of them? In AutoCAD this is solved using cyclic selection. When you press CTRL and later select an object that's over any other objects it gets "preselected" and is highlighted in dashed lines, if you keep left-clicking then the object that is preselected rotates through all the piled objects, until you press enter or right-click. After this point you have a new selected object... you could continue adding some more objects to the selection using any mode, add another one in the pile using again this mode... To deselect objects you use SHIFT while selecting the object to be deselected. > > Regards, > Jose Antonio I hope this brings in some new ideas, Rafael Villar Burke