Author Topic: [Specifications] Layer Set Function  (Read 6143 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
[Specifications] Layer Set Function
« on: October 05, 2005, 02:25:29 AM »
[Specifications] Layer Set Function.


1: }

2: }

3: }

4: }

5: }

6: }

7: }

8: }

9: }

10: }

11: }

12: }

13: }

?? What are the specifications .

PS : No Code Please untill the specifications are agreed upon.


[added]

[Specifications] Layer Set Function.

Possible Parameters :
  • Layer Name
  • Required Properties
  • Required Status
  • Other ??

Assertions :
  • Determine if the layer exist .. Make if not < either use properties or defaults >.
  • Determine if usable ..  Do we change it ??
  • Other ??

Associated Assertions :
  • Linetype < file depends on units ; scale ; >
  • Other ??

Actions:
  • Set Status
  • Set Properties ??
  • Other ??

Return :
Layer ObjectID or NIL

Unresolved Design querys :

  • If Layer is changed, Do we save the name of current layer From this module or from caller ?
  • If properties are changed, do we save the current for restoration( and; from this module or from caller > ?
  • What level of error trapping is required ?
  • Other ??

Do we work to these 2 scenarios
Either :
  • Just check the layer exists ; say we are using CHPROP or functionality that requires the layer..
  • Force the layer to be current ; say we want to draw onto it.
  • Other ??


.. any others ??
[/added]

[update] to suit input [/update]
« Last Edit: October 08, 2005, 01:30:19 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: [Specifications] Layer Set Function
« Reply #1 on: October 05, 2005, 02:34:10 AM »
I am a firm believer that most code writes itself if the specifications and then pseudocode are written properly.

As with all problem solving, the quality of the question in part determines the quality of the answer.

Please note that the title is NOT a true description of the brief. Layer Set Function could mean anything <well, almost>


It would be nice if there was also some input from other than the usual suspects .. :)
« Last Edit: October 05, 2005, 02:37:17 AM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: [Specifications] Layer Set Function
« Reply #2 on: October 05, 2005, 08:10:10 AM »
[Specifications] Layer Set Function.

1: Determine if the layer exist

2: if it exist then thaw, unlock, turn on, set current

3: if it does not exist MAKE it, options are name, color, linetype

4: make sure the options are valid or catch the error

{good morning} :-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: [Specifications] Layer Set Function
« Reply #3 on: October 05, 2005, 08:18:51 AM »
Addendum: Add a flag to indicate whether the proposed layer name must pass (snvalid layername 0|1) test(s).
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: [Specifications] Layer Set Function
« Reply #4 on: October 05, 2005, 08:33:58 AM »
To begin with I believe it is imperitive to determine if the layer exists, then you can verify whether or not the layer is locked, off, or frozen (a locked, off or frozen current layer is not a good thing). That being said, if this is going to be a true "layer set function", we probably don't need to create the layer if it does not exist, rather it should return the current layer if it exists or nil if it does not.
I suggest a wrapper function for activex as well, thus the set layer command could be used in both plain lisp and vlisp.
Now perhaps I may be looking too deeply into the function, but aside from the regular "set layer" functionality (if that is indeed the purpose) why not have the ability to set the properties of the layer, those properties being ... current, color, name, linetype, lineweight, plot, noplot, lock, unlock, freeze, thaw, on, off. i.e. (LayerSet "somelayer" "current" nil) or (LayerSet "somelayer" "name" "differentname")

It just occured to me that we could use constants to define the differing states ...
vlCurrent
vlName
vlPlot
etc ....
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

SMadsen

  • Guest
Re: [Specifications] Layer Set Function
« Reply #5 on: October 05, 2005, 10:09:44 AM »
For LayerSet calling function:

1: ...

2: ...

n: Record current layer

n+1: Call LayerSet

n+2: If LayerSet then add current layer to history

n+3: Provide LayerSetPrevious(history) option

n+4: ...

Hangman

  • Guest
Re: [Specifications] Layer Set Function
« Reply #6 on: October 05, 2005, 10:10:34 AM »
Uhh...  Yea...  What they said.   :-)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: [Specifications] Layer Set Function
« Reply #7 on: October 05, 2005, 10:24:32 AM »
Quote
... title is NOT a true description of the brief. Layer Set Function could mean anything <well, almost>

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

LE

  • Guest
Re: [Specifications] Layer Set Function
« Reply #8 on: October 05, 2005, 10:42:25 AM »
I am a firm believer that most code writes itself if the specifications and then pseudocode are written properly.

I must admit, I never had followed any pseudocode....  :-(

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: [Specifications] Layer Set Function
« Reply #9 on: October 05, 2005, 10:45:46 AM »
Hi Louis, you probably do yours in your head, just sitting down quietly and thinking through a problem and making notes is a form of code design.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: [Specifications] Layer Set Function
« Reply #10 on: October 05, 2005, 03:34:53 PM »
Don't forget to check VP layer status...
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Crank

  • Water Moccasin
  • Posts: 1503
Re: [Specifications] Layer Set Function
« Reply #11 on: October 05, 2005, 05:38:21 PM »
.. and the description...
Vault Professional 2023     +     AEC Collection

Bob Wahr

  • Guest
Re: [Specifications] Layer Set Function
« Reply #12 on: October 05, 2005, 06:23:50 PM »
Quote
... title is NOT a true description of the brief. Layer Set Function could mean anything <well, almost>
In it's basest form,
  • check for layer
  • If exists, set layer to current
  • Else, do nothing
  • Get out
If it is essential that the layer exist and be set then base
  • check for layer
  • If not exists, make layer
  • set layer
  • Get out
Optimally if the end result is to have a specific layer with the current properties needs to be set current
  • check for layer
  • If not exists, make layer,set all required properties of layer
  • set layer
  • Get out
It could be much, much different depending on what actually is desired/required.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: [Specifications] Layer Set Function
« Reply #13 on: October 05, 2005, 06:53:32 PM »
Quote
It could be much, much different depending on what actually is desired/required.

The idea of the thread is to find out what people think IS required from a routine like this. If YOU were contracting to have the code written what would you want the routine to do ? explicitly. not HOW just WHAT.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Bob Wahr

  • Guest
Re: [Specifications] Layer Set Function
« Reply #14 on: October 05, 2005, 07:25:31 PM »
I guess then that if I were contracting I would want the third option I listed along with additional functions to

a) get current layer state
b) reset to layer state obtained with 'a'

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: [Specifications] Layer Set Function
« Reply #15 on: October 08, 2005, 01:26:35 AM »
Refer to the original post for Updates :

Any more comments ??
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.