Author Topic: New Project Step 1 Linetypes  (Read 16038 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4073
New Project Step 1 Linetypes
« Reply #45 on: July 12, 2005, 01:50:40 PM »
For everyone following along, Were you able to load linetype without errors?  If you got an error, was it resolved by switching to Unhandled errors only?  We are going to move to Layers next, if no one has questions about loading linetypes.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4073
New Project Step 1 Linetypes
« Reply #46 on: July 12, 2005, 03:08:08 PM »
If you are comefortable, move on to Step 2
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4073
New Project Step 1 Linetypes
« Reply #47 on: July 12, 2005, 06:17:44 PM »
For those that are done and want a PDF, here it is.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Birdy

  • Guest
New Project Step 1 Linetypes
« Reply #48 on: July 15, 2005, 08:07:11 PM »
Sorry for the absence, heavy work load this week.
:( I had to reread your primers on how to
work the blasted IDE. (good stuff btw-thanks)
For some unknown reason, I crashed my 'pooters both here at home and at work.  Don't know what it was, but "I'm feeling much better now." :)

Ok, here we go with the ketchup questions, or WILT:
Code: [Select]
Public Sub LLine() the "LLine" could be anything I want? Kinda like defun ---?

Code: [Select]
ThisDrawing Is this an example of the camel case you mentioned before? Not absolutely necessary from a syntax standpoint but just considered "good form"?

I tried using a "on error resume next", just like you said NOT to and it didn't seem to work. Kept getting an error message "duplicate record name". No code number.  Shouldn't this work for such a simple macro?
Woops. Maybe cause i had this
Code: [Select]
Public Sub LLINE()

ThisDrawing.Linetypes.Load "HIDDEN", "ACAD.LIN"
ThisDrawing.Linetypes.Load "DASHED", "ACAD.LIN"
On Error Resume Next
End Sub

instead of this
Code: [Select]
Public Sub LLINE()
On Error Resume Next
ThisDrawing.Linetypes.Load "HIDDEN", "ACAD.LIN"
ThisDrawing.Linetypes.Load "DASHED", "ACAD.LIN"

End Sub


Tools->Options, General Tab, Error Trapping, Break on UnHandled Errors. <---Should this 'generally' be set as a default in the IDE? Or is that "a question that really doesn't need to be asked" at this point?

I was just saving the macro code in the drawing file itself, and then toggling to acad, & alt+F8, rather than saving the file out to a directory as <filename.dvb> and then appload-ing from acad.  What is the difference between these two methods?  As far as I can tell, they do the same thing.
Is the first method only available in that specific drawing, and I won't be able to use it from another drawing file?  When is one preferred over the other?

Finally,
Code: [Select]
Case Else:
Err.Raise Err.Number, Err.Source, Err.Description, Err.HelpFile, Err.HelpContext
I don't understand what this does.  I mean, if the macro tries... wait, is this just a "catch all" kinda thing to throw up an error message for any OTHER (ie not error code -2145386405) type of error that may be encountered?

Otherwsie, I seem to have it working.  Not sure I really know much more than I did before, but it sure feels like it!

Oh, one other thing.  That drop down thingy when you hit the 'dot' is pretty cool... or so it seems at this point.

Thanks for the patience. Moving on to step 2 now.  :)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4073
New Project Step 1 Linetypes
« Reply #49 on: July 16, 2005, 01:26:37 PM »
Quote from: Birdy
Sorry for the absence, heavy work load this week.
Better late than never..
Quote from: Birdy
Code: [Select]
Public Sub LLine() the "LLine" could be anything I want? Kinda like defun ---?
Yes it could have been Public Sub Bird-Lines()

Quote from: Birdy
Code: [Select]
ThisDrawing Is this an example of the camel case you mentioned before? Not absolutely necessary from a syntax standpoint but just considered "good form"?

yes and no, In this case, VBA is/will going to fix whatever you type to fit the notation.  Where you should be concentrating on is how you want to
name your variables that VBA does not auto handle i.e. strDrawingName for a string for the Drawing name

Quote from: Birdy
I tried using a "on error resume next", just like you said NOT to and it didn't seem to work. Kept getting an error message "duplicate record name". No code number.  Shouldn't this work for such a simple macro?
Woops. Maybe cause i had this
Code: [Select]
Public Sub LLINE()
ThisDrawing.Linetypes.Load "HIDDEN", "ACAD.LIN"
ThisDrawing.Linetypes.Load "DASHED", "ACAD.LIN"
On Error Resume Next
End Sub

instead of this
Code: [Select]
Public Sub LLINE()
On Error Resume Next
ThisDrawing.Linetypes.Load "HIDDEN", "ACAD.LIN"
ThisDrawing.Linetypes.Load "DASHED", "ACAD.LIN"

End Sub

Tools->Options, General Tab, Error Trapping, Break on UnHandled Errors. <---Should this 'generally' be set as a default in the IDE?
OK, first, it kept giving you the box b/c we were breaking on ALL errors.  
This was a setting I should have had everyone set before.  Yes it shold be default, at some point.  I know that sounds vauge,(sp) but it depends on
your comfort level.  The difference between the 2 settings is 1 breaks on every error(duh) and the other breaks on any un-handled error.
What that means in a nutshell is break if I didnt try to catch it.  Does that make sense?
As to the second part of that question, it didn't work in the first ex b/c you raised an error before you told it to resume if an error came up.
thats why it worked in the second ex.  You told it to resume, and it did
Quote from: Birdy

Finally,
Code: [Select]
Case Else:
Err.Raise Err.Number, Err.Source, Err.Description, Err.HelpFile, Err.HelpContext
I don't understand what this does.  I mean, if the macro tries... wait, is this just a "catch all" kinda thing to throw up an error message for any OTHER (ie not error code -2145386405) type of error that may be encountered?
Yes, its a catch all
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Birdy

  • Guest
New Project Step 1 Linetypes
« Reply #50 on: July 16, 2005, 04:51:54 PM »
Thanks for the feedback.  I actually feel like I DID learn something.
Quote from: CmdrDuh

What that means in a nutshell is break if I didnt try to catch it. Does that make sense?

Yep.