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

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #45 on: April 06, 2011, 11:07:54 AM »
Quote
i vote txt file (so it would be avail after a restart)
Quote
the layer setup may be quite different from file to file,

Why not an Xrecord in a Dictionary ?

My preference.  Establish a dictionary under the named object dictionary, with a sub-dictionary for settings like last-selected layer, last dialog selection, etc.  Safe, doesn't require extenstive permissions like registry keys might, doesn't rely on search paths and their possible write permissions like a text file, and stored per drawing.

Really? I'm surprised - I wouldn't have thought one would want all this extra baggage to bloat a drawing just for the sake of remembering a dialog selection. Hence why I thought a simple global variable would suffice.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #46 on: April 06, 2011, 11:10:10 AM »
Quote
i vote txt file (so it would be avail after a restart)
Quote
the layer setup may be quite different from file to file,

Why not an Xrecord in a Dictionary ?

My preference.  Establish a dictionary under the named object dictionary, with a sub-dictionary for settings like last-selected layer, last dialog selection, etc.  Safe, doesn't require extenstive permissions like registry keys might, doesn't rely on search paths and their possible write permissions like a text file, and stored per drawing.

Really? I'm surprised - I wouldn't have thought one would want all this extra baggage to bloat a drawing just for the sake of remembering a dialog selection. Hence why I thought a simple global variable would suffice.
I have to agree with Lee. I can't imagine where the last selected layer would be good past the active drawing's current run.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #47 on: April 06, 2011, 12:11:42 PM »
I just tried to reply to the 2 requests:
- [se7en] keep the value after closing the drawing (a global variable won't)
- [Lee] have a value per drawing (a .txt file could but it needs something like a line per drawing/value)

What's wrong with the dictionary ?
It could be a 'ldata' too if the application only uses LISP.
Speaking English as a French Frog

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #48 on: April 06, 2011, 01:03:53 PM »
good idea gile but I dont really mind any solution. The main reason I am still on the fence is because I'm still wondering if its a "usefull feature" (If its a usefull feature for people im cool with either concept).

When the dialog pops up the last layer will be highlighted?

The long and the short is, if you guys think its a usefull feature im on board with it. If we have to choose a solution i think gile hit on a good idea (but yes, a global var would be easier and less code). bleh, i'm just muddling this decision. Decide and we'll add it to the criteria.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

barc

  • Guest
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #49 on: April 06, 2011, 01:12:04 PM »
Not being a coder lemme throw in here.

#1)  It may be useful to some and not others, the kind of stuff I do most often is unique enough I probably won't need it that often, but that's ME.

#2)  As a group for this effort, (remembering that the effort is as much or more about working as a group than it is about the end product), do we as a group want to code more or code less for our first attempt at a group project?  Leaving the endproduct aside for a minute we might consider that less may be more for our first foray, but more may be beneficial for the group health.  Dunno, just saying.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #50 on: April 06, 2011, 02:22:00 PM »
Quote
i vote txt file (so it would be avail after a restart)
Quote
the layer setup may be quite different from file to file,

Why not an Xrecord in a Dictionary ?

My preference.  Establish a dictionary under the named object dictionary, with a sub-dictionary for settings like last-selected layer, last dialog selection, etc.  Safe, doesn't require extenstive permissions like registry keys might, doesn't rely on search paths and their possible write permissions like a text file, and stored per drawing.

Really? I'm surprised - I wouldn't have thought one would want all this extra baggage to bloat a drawing just for the sake of remembering a dialog selection. Hence why I thought a simple global variable would suffice.

You'll have to trust me - VERY little bloat involved with this method.  At least on the storage side.  It does require more code than a global variable, and only slightly more than for reading/writing a text file once you validate the input/output.

As also mentioned, the simplicity of a global variable might be best for the design stage.  Wrapping the global variable with a set/return function will enable the method to be easily replaced in a code branch later on.
If you are going to fly by the seat of your pants, expect friction burns.

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

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #51 on: April 06, 2011, 02:31:58 PM »
The way I see it:

  • Whether it will be useful for the user or not, the dialog list_box requires an initial selection, hence it might as well be the previously selected layer from the dialog.
  • The goal of this program is to aid drafting and shouldn't affect the drawing itself, so the setting shouldn't be tied to the drawing - this point is even more valid considering that a percentage of users may not even require the setting to be remembered and many are probably not overkeen on such an app altering their drawings just to set an object's layer.
  • As a global variable, the drawing (and system) is unaffected either way, so a user on both sides of the fence is happy.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #52 on: April 06, 2011, 02:40:16 PM »
The way I see it:

  • Whether it will be useful for the user or not, the dialog list_box requires an initial selection, hence it might as well be the previously selected layer from the dialog.
  • The goal of this program is to aid drafting and shouldn't affect the drawing itself, so the setting shouldn't be tied to the drawing - this point is even more valid considering that a percentage of users may not even require the setting to be remembered and many are probably not overkeen on such an app altering their drawings just to set an object's layer.
  • As a global variable, the drawing (and system) is unaffected either way, so a user on both sides of the fence is happy.
While I agree that using ldata/xdata wouldn't clog up the system, I still have to agree with Lee on this. A global variable is the least intrusive and for what it's accomplishing, it more that sufficient.
I have to know, what's the aversion to using a simple global variable?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

gile

  • Gator
  • Posts: 2507
  • Marseille, France
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #53 on: April 06, 2011, 03:05:52 PM »
Quote
I have to know, what's the aversion to using a simple global variable?

I've no aversion to use one or another way, I just wanted to say the choose of a route must be dictated by goal.
Maybe, one more time, I misunderstood the request (due to my poor English) and it's the main reason I won't join this group.
I thaught the data had to be preserved after the drawing was closed, so a global variable won't be a good choice.

So to resume, before discussing which way is the best, have to decide where to go.
Speaking English as a French Frog

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #54 on: April 06, 2011, 03:09:22 PM »
Applications modify drawings all the time without users having a clue as to whats being done.

A variable for this, a variable for that... they get out of hand easily and I'd prefer to avoid a precedent.  They are also easy to modify in an uncontrolled fashion which can cause problems in collaborative efforts.  Maybe its just the methodology I've adopted.  I *do* use a few global variables for things like application names, but for the most part use functions to return values instead.  Then if the method of getting the value (hard-coded vs. registry, for example), it only needs to be changed in one place rather than find/replacing every reference.
If you are going to fly by the seat of your pants, expect friction burns.

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

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #55 on: April 06, 2011, 03:09:36 PM »
I thaught the data had to be preserved after the drawing was closed, so a global variable won't be a good choice.

Ahh, OK. I'll keep my mouth shut.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #56 on: April 06, 2011, 03:24:53 PM »
Applications modify drawings all the time without users having a clue as to whats being done.

That may be, but why are you encouraging that practice?

A variable for this, a variable for that... they get out of hand easily and I'd prefer to avoid a precedent. 

1 Variable: the Layer Name.

Seriously, this seems like arguing a moot point for the sake of it.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #57 on: April 06, 2011, 03:26:03 PM »
Seriously, this seems like arguing a moot point for the sake of it.
Whatever, I totally disagree.  :evil:
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #58 on: April 06, 2011, 03:33:18 PM »
Seriously, this seems like arguing a moot point for the sake of it.
Whatever, I totally disagree.  :evil:

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Group Project: Change item(s) to Layer [VOTE]
« Reply #59 on: April 06, 2011, 04:15:56 PM »
Applications modify drawings all the time without users having a clue as to whats being done.

That may be, but why are you encouraging that practice?

A variable for this, a variable for that... they get out of hand easily and I'd prefer to avoid a precedent. 

1 Variable: the Layer Name.

Seriously, this seems like arguing a moot point for the sake of it.

Sorry - not intending to argue.

Can we agree to put a pin in it until later?  I think we still need to mock up the UI and decide what (if any) of the settings will be saved, and the save scope, before looking at how that data would be saved.
If you are going to fly by the seat of your pants, expect friction burns.

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