Author Topic: Group Project: Change item(s) to Layer [Discussion]  (Read 27066 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #15 on: April 15, 2011, 01:27:26 PM »
I like it Lee! Can we get some border around the VII part ...make it more ominous looking.

How about a touch of shadow/contour - check the updated above  :-)

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #16 on: April 15, 2011, 02:14:26 PM »
HTML for the documentation is good; as text it can be change-managed through the SVN.  Other files like CHM can also be managed but they would have to be checked in/out.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

pBe

  • Bull Frog
  • Posts: 402
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #17 on: April 16, 2011, 01:09:16 AM »
Quote
Toggle button for option to Unlock based on two points obtain thru ssget before proceeding to add new objects to selection set
   if Enabled
      initiate 7WIP:ReselectPreviousLocked subfunction

Everyone concur with this?



JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #18 on: April 16, 2011, 01:34:39 PM »
I'm not sure i understand that section pBe. I was re-reading the PSEUDO code and that part confuses me. Does that mean that you are suggesting that we retain the previous selection(s)?

If you are referring to an option to unlock a layer; the locked, frozen, off, and xref layers will not be displayed in the dialog.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #19 on: April 16, 2011, 02:27:37 PM »
Here is how I might approach the pseudo code to tie in with my submission here:

Code: [Select]
;;--------------------={ Project7 }=--------------------;;
;;       Change Item(s) to Layer  -  PSEUDO CODE        ;;
;;------------------------------------------------------;;

+----->  Cycle through Layer Table (tblnext) and construct a
|        list of layer names, excluding XRef layers (not (wcmatch "*|*")).
|
|
+----->  Prompt for Selection of Objects (ssget), use "_:L" mode string
|        to exclude objects on locked layers.
|
|
+--+-->  IF non-nil SelectionSet
|  |
|  |
|  |
|  +--+  THEN:
|  |  |
|  |  |
|  |  |
|  |  +-->  Call 7WIP:GetLayerSelection with list of layer names
|  |  |     [sorted in Alphabetical order?]
|  |  |
|  |  |
|  |  +-->  IF 7WIP:GetLayerSelection returns valid layer selection
|  |  |
|  |  |
|  |  |
|  |  +--+  THEN:
|  |  |  |
|  |  |  |
|  |  |  |
|  |  |  +-->  Iterate through SelectionSet and call
|  |  |        7WIP:ChangeEntityLayer to change the layer of each
|  |  |        entity to the chosen layer.
|  |  |
|  |  +--+  ELSE:
|  |     |
|  |     |
|  |     |
|  |     +-->  Princ *Cancel* as User pressed Dialog Cancel button
|  |
|  |
|  |
|  +--+  ELSE:
|     |
|     |
|     |
|     +-->  Princ *Cancel* as User hasn't selected anything
|
|
|
+-->  Exit Cleanly

Or, alternatively (my preference), use a single COND instead of nested IF statements:

Code: [Select]
;;--------------------={ Project7 }=--------------------;;
;;       Change Item(s) to Layer  -  PSEUDO CODE        ;;
;;------------------------------------------------------;;

+----->  Cycle through Layer Table (tblnext) and construct a
|        list of layer names, excluding XRef layers (not (wcmatch "*|*")).
|
|
+----->  Prompt for Selection of Objects (ssget), use "_:L" mode string
|        to exclude objects on locked layers.
|
|
+--+-->  Start COND
|  |
|  |
|  |
|  +--+  Condition 1: (null SelectionSet)
|  |  |
|  |  |
|  |  |
|  |  +-->  Princ *Cancel* as User hasn't selected anything
|  |
|  |
|  |
|  +--+  Condition 2: Call 7WIP:GetLayerSelection with list of layer names
|  |  |               [sorted in Alphabetical order?]
|  |  |               (null 7WIP:GetLayerSelection)
|  |  |
|  |  +-->  Princ *Cancel* as User pressed Dialog Cancel button
|  |
|  |
|  |
|  +--+  Default Condition => Valid Selection & Selected Layer
|     |
|     |
|     |
|     +-->  Iterate through SelectionSet and call
|           7WIP:ChangeEntityLayer to change the layer of each
|           entity to the chosen layer.
|
|
|
+-->  Exit Cleanly

IMO, the COND structure is a lot cleaner, not to mention more readable since there is no nesting.

Lee

pBe

  • Bull Frog
  • Posts: 402
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #20 on: April 17, 2011, 02:25:10 AM »
I'm not sure i understand that section pBe. I was re-reading the PSEUDO code and that part confuses me. Does that mean that you are suggesting that we retain the previous selection(s)?

If you are referring to an option to unlock a layer; the locked, frozen, off, and xref layers will not be displayed in the dialog.

oh i see, i was not referring to the destination layer but the selected objects layer ,reason why included that option if by somehow the user invoke the tool before selection and realize afterwards the object is locked while in selection mode, a toggle button to unlock would be handy instead of exiting the tool and unlocking the layer outside the tool. or perhaps a better selection method should be use?  forcing the objects layer to unlock when selected?




pBe

  • Bull Frog
  • Posts: 402
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #21 on: April 17, 2011, 02:27:24 AM »
Or, alternatively (my preference), use a single COND instead of nested IF statements:

IMO, the COND structure is a lot cleaner, not to mention more readable since there is no nesting.

Lee

I concur COND is indeed cleaner

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #22 on: April 18, 2011, 02:14:08 PM »
Attached is a quickie outline for submitting work via SVN.  The document is stored in the repository (upload is from my own working copy, in fact 8-) ).

If the coders aren't comfortable with using the SVN interface for the first bit, I can do some check in/out on their behalf but it will be batched once or twice a week.  Once the project gets rolling SVN use will be mandatory to avoid coding conflicts.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #23 on: April 19, 2011, 08:29:47 AM »
Awesome dgorsman.

I had some documentation for using Vim, and Tortoise SVN. ...ah, here it is.
[ http://www.theswamp.org/index.php?topic=30237.0 ]
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #24 on: April 19, 2011, 10:40:40 PM »
Sorry if the format of this file is wrong but I did this on my PDA (as well as this post). I will redo it when I get on a pc if its all goofy.

Here is a documentation template for the Soldiers.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #25 on: April 20, 2011, 08:11:37 AM »
Is there agreement on the Psuedo code as previously posted?

Should I send my code snippet to dgorsman to be added to this SVN thing?

Chris

  • Swamp Rat
  • Posts: 547
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #26 on: April 20, 2011, 08:21:06 AM »
what kind of help format are we looking for here, do we want something that looks like it is part of AutoCAD (mimics the basic color scheme and formating of AutoCAD's help) or come up with our own style?
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #27 on: April 20, 2011, 08:40:47 AM »
Is there agreement on the Psuedo code as previously posted?

Should I send my code snippet to dgorsman to be added to this SVN thing?

I would recomend that you try SVN yourself. But i dont know where dgorsman stands; i need to download SVN here so i can check out whats there (hang tight a little longer).

I didnt really sense a concensis on the pseudo code issue(s) but i will chime in and get that ball rolling again today.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #28 on: April 20, 2011, 08:41:41 AM »
what kind of help format are we looking for here, do we want something that looks like it is part of AutoCAD (mimics the basic color scheme and formating of AutoCAD's help) or come up with our own style?

We can do our own; that would be easier and the help docs for AutoCAD are not the best format IMO.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #29 on: April 20, 2011, 01:23:09 PM »
Here is how I might approach the pseudo code to tie in with my submission here:
Code: [Select]
;;--------------------={ Project7 }=--------------------;;
;;       Change Item(s) to Layer  -  PSEUDO CODE        ;;
;;------------------------------------------------------;;

+----->  Cycle through Layer Table (tblnext) and construct a
|        list of layer names, excluding XRef layers (not (wcmatch "*|*")).
|
|
+----->  Prompt for Selection of Objects (ssget), use "_:L" mode string
|        to exclude objects on locked layers.
|
|
+--+-->  Start COND
|  |
...

The above pseudo code has my vote but i want to ask if there was a reason why the `layer table iterating' is done so early?

Would this work instead?

Code: [Select]
;;--------------------={ Project7 }=--------------------;;
;;       Change Item(s) to Layer  -  PSEUDO CODE        ;;
;;------------------------------------------------------;;

+----->  Prompt for Selection of Objects (ssget), use "_:L" mode string
|        to exclude objects on locked layers.
|
+--+-->  Start COND
|  |
|  |
|  +--+  Condition 1: (null SelectionSet)
|  |  |
|  |  +-->  Princ *Cancel* as User hasn't selected anything
|  |
|  |
|  +--+  Condition 2: Call 7WIP:GetLayerSelection with list of layer names
|  |  |               [sorted in Alphabetical order?]   [color=red]<---- sure[/color]
|  |  |               (null 7WIP:GetLayerSelection)     [color=red]<---- what is this?[/color]
|  |  |
|  |  +-->  Princ *Cancel* as User pressed Dialog Cancel button
|  |
|  |
|  +--+  Default Condition => Valid Selection & Selected Layer
|     |
|     +-----+  Cycle through Layer Table (tblnext) and construct a
|           |  list of layer names, excluding XRef layers
|           |  (not (wcmatch "*|*")) and layers that are off, frozen,
|           |  and locked.
|           |
|           +-->  Iterate through SelectionSet and call
|                 7WIP:ChangeEntityLayer to change the layer of each
|                 entity to the chosen layer.
|
+-->  Exit Cleanly
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org