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

0 Members and 1 Guest are viewing this topic.

Chris

  • Swamp Rat
  • Posts: 547
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #30 on: April 20, 2011, 01:29:28 PM »
I would tend to think the second option would be better, as there is no point in cycling through the layers if the command is just going to get canceled out.  My question would be, instead of just exiting if there is no selection set, should you first give the user the option to select a selection, and if it is still nil, exit out.  Or is that too many extra prompts and not streamlined enough?
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #31 on: April 20, 2011, 01:30:13 PM »
The layer table needs to be iterated before '7WIP:GetLayerSelection' is called, as this function requires a list of Layer names to display in the dialog. It could be iterated after a valid selection is made I suppose, although I thought the code would look cleaner/more readable with the construction of the list of layers outside of the COND statement.

As for :

Code: [Select]
(null 7WIP:GetLayerSelection)     <---- what is this?
This is the test condition for the second COND statement, i.e. if (null 7WIP:GetLayerSelection) returns T, princ *Cancel*.

Lee

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #32 on: April 20, 2011, 01:32:23 PM »
My question would be, instead of just exiting if there is no selection set, should you first give the user the option to select a selection, and if it is still nil, exit out.  Or is that too many extra prompts and not streamlined enough?

Note that the user is prompted for a selection, then this selection is tested - this would allow both an implied selection and, if no implied selection is present, will prompt the user.

Chris

  • Swamp Rat
  • Posts: 547
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #33 on: April 20, 2011, 01:36:12 PM »
Ok, makes sense.  I'm having some issues with how I'm seeing posts in the thread, I think its just a setting on my end.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

JohnK

  • Administrator
  • Seagull
  • Posts: 10604
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #34 on: April 20, 2011, 01:41:56 PM »
Ah, gotcha.

Okay, I moved the layer iterating below object selection and this looks good to me if you guys agree too?

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.
|
+----->  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.
|
+--+-->  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
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #35 on: April 20, 2011, 01:43:43 PM »
That would be no different to my original though, since the validity of the SelectionSet is tested after the Table is iterated.

EDIT: [After more thinking] I suppose it would be more efficient for those cases in which the user hits Esc at the Selection prompt - Agree.
« Last Edit: April 20, 2011, 01:47:30 PM by Lee Mac »

Chris

  • Swamp Rat
  • Posts: 547
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #36 on: April 20, 2011, 02:05:42 PM »
sounds good to me.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

JohnK

  • Administrator
  • Seagull
  • Posts: 10604
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #37 on: April 20, 2011, 02:12:23 PM »
great. Pseudo code is done.

Again, this group thing is fun (slow, but fun).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #38 on: April 20, 2011, 03:18:01 PM »
Wouldn't it make more sense to:
  • Check validity of selection as it's executed (eg. if or cond)
  • create layer list and feed it to dialog selection
  • iterate through selection set and put objects on defined layer

Code: [Select]
(cond ((not (setq selectionset (ssget "_:L"))))
      ((not (setq targetlayer (7WIP:GetLayerSelection (7WIP:GetLayerList)))))
      (T step through selectionset and put entities on defined layer)
)

OR

Code: [Select]
(if (and (setq selectionset (ssget "_:L"))
         (setq targetlayer (7WIP:GetLayerSelection (7WIP:GetLayerList)))
    )
  (progn step through selectionset and put entities on defined layer)
)

or am I missing something?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #39 on: April 20, 2011, 03:20:57 PM »
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'd prefer coders get used to using the SVN, if only for their own education.  Future projects may be much larger and require the diff-patch method rather than a simple check in/out.  I think the documention/assassins should be online as well so the documentation is automatically distributed.
If you are going to fly by the seat of your pants, expect friction burns.

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

Chris

  • Swamp Rat
  • Posts: 547
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #40 on: April 20, 2011, 03:29:59 PM »
I agree about being on line, if the help documents arnt all there, you wont be able to see images, hyperlinks wont work, etc..
little confused about the SVN thing, I think I understand the procedure file, but I'm getting a page error when I go to tortisesvn.tigris.org

Se7en, When you refer to the AutoCAD help not being structured well, are you referring to the later versions, or some of the earlier ones, or both?
« Last Edit: April 20, 2011, 03:34:42 PM by Chris »
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

Chris

  • Swamp Rat
  • Posts: 547
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #41 on: April 20, 2011, 03:57:04 PM »
We could call the project: "Project7"

Sounds cool.

Well I like it but I may be a little biased. *lol*

Speaking of titles/names: Who can draw? Can we get a simple logo for the docs (or is that a bit too much)?

Perhaps?


Lee,
Can I get this png with white text/lighter text, for darker backgrounds?  that way we'll have one of each.
Thanks,
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #42 on: April 20, 2011, 04:00:03 PM »
We could call the project: "Project7"

Sounds cool.

Well I like it but I may be a little biased. *lol*

Speaking of titles/names: Who can draw? Can we get a simple logo for the docs (or is that a bit too much)?

Perhaps?


Lee,
Can I get this png with white text, for darker backgrounds?  that way we'll have one of each.
Thanks,
I'd either set the 'Project' text to be a little more bold (washes out in some areas overlaying the "VII") and if it were me, I'd go as far to say that a "7" would look cooler. What if we follow take from hacker text and use Projec7? Although, most probably wouldn't get it.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Chris

  • Swamp Rat
  • Posts: 547
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #43 on: April 20, 2011, 04:22:35 PM »
the logo doesnt matter much to me.  Now that you mention it, it does look like it washes over the red text. I was just thinking if we use a dark background for our help file header area, a light colored logo would be nice, and if we have any white space areas that contain the logo, the dark logo would go there.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: Group Project: Change item(s) to Layer [Discussion]
« Reply #44 on: April 20, 2011, 04:22:55 PM »
We could call the project: "Project7"

Sounds cool.

Well I like it but I may be a little biased. *lol*

Speaking of titles/names: Who can draw? Can we get a simple logo for the docs (or is that a bit too much)?

Perhaps?


Lee,
Can I get this png with white text/lighter text, for darker backgrounds?  that way we'll have one of each.
Thanks,

Sure Chris: