How to start autocad from VB (not VBA)

Discussion in 'AutoCAD' started by Paul-de-Boer, Jan 27, 2005.

  1. A function is not a var. It is specifically designed for use elsewhere
    and as such should be as clear as possible.
    If we were talking about a paradigm shift, I might understand your
    resistance. As it stands, I do not understand the objection to
    self-documenting code. It's easier to maintain and does not rely on what
    may or may not be known by the reader.

    There's more to programming than coding.
     
    Frank Oquendo, Jan 28, 2005
    #21
  2. I agree with you, Frank, that the explicit init (whether variable or f'n)
    adds clarity and removes ambiguity by not depending on language-specific
    behaviors. This would be very helpful if, say, a C expert with little VB
    experience wanted to port the code. But I would also say that
    language-specific tricks abound (and are utilized for performance, etc) in
    most code, such as the short-circuiting of IF statements in C that came up
    in a nearby thread. Not that you didn't know this, obviously, but I wanted
    to see if you felt that short-circuiting should not be counted on in C to
    prevent invalid functions, but instead IF statements in C should be
    re-written as a nested statement or something that would work in VB.

    Just wanted to stir the nest a little... :)

    James
     
    James Belshan, Jan 28, 2005
    #22
  3. Paul-de-Boer

    LochDhu Guest

    As it stands, I do not understand the objection to
    Frank,

    I have no objection to self-documenting coding. I just feel that this
    particular issue is not worth an arguement.

    There's that sweet spot of documentation where you get enough to give people
    what they need, but not too much to irritate the reader or the writer.

    Do you use Massive Function Headers?
    http://c2.com/cgi/wiki?MassiveFunctionHeaders
    I respect your views and thoughts Frank - have a good evening.


    Scott
     
    LochDhu, Jan 28, 2005
    #23
  4. Actually, there are two versions of the AND and OR logical operators in
    C++: | and || (OR and short-circuit OR) as well as & and && (AND and
    short-circuit AND).

    As you can see, short circuiting is not a default behvior and wholly
    self documenting. However, there things like 'if ( !someVar )' where
    someVar is NULL so the expression evaluates to TRUE.

    While C++ lets you do this sort of thing, I avoid it entirely.
     
    Frank Oquendo, Jan 28, 2005
    #24
  5. Is that a jibe or a question?

    In any event, the answer is no. Self-documenting code doesn't need such
    a long introduction.
     
    Frank Oquendo, Jan 28, 2005
    #25
  6. Hey Scott, nice to see you back!

    Never. I'll always either use L/UBound or iterate depending upon whether I
    need the actual position or not. I also would never use "i', I'd use short
    Hungarian - iCntr or iIndex.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Jan 28, 2005
    #26
  7. Paul-de-Boer

    Paul-de-Boer Guest

    Sorry for the misunderstanding i meant without referencing the ACAD model. I want to start acad.exe with the use of parameters, for example acad.exe /t (were /t stands for template). I can't find any documentation about parameters to switch to a layout within a acad document.

    [PathName]\acad.exe "dwgname" and then some kind of parameter to switch to a layout within the specified document.

    I'm using ACAD 2004

    Again sorry for the misunderstanding, i should have bin more specific.

    Many thanks
    P de Boer
     
    Paul-de-Boer, Jan 28, 2005
    #27
  8. Paul-de-Boer

    fantum Guest

    Check the documentation:

    User's Guide>The User Interface>Customize the Drawing Environment>Customize Startup
     
    fantum, Jan 28, 2005
    #28
  9. Dim RetVal
    RetVal = Shell("C:\Program Files\ACAD.EXE etc...", 1)
     
    Jorge Jimenez, Jan 28, 2005
    #29
  10. Paul-de-Boer

    VBA Guest

    Read the help excerpt I posted.


     
    VBA, Jan 31, 2005
    #30
  11. I can't believe the reaction you have got just because Frank didn't know that a boolean defaults to a false value. I do not believe you should have to cater for people reading your program being ignorant of features.
    Regards - Nathan
     
    Nathan Taylor, Jan 31, 2005
    #31
  12. The central issue is self-documenting code, not who knows what about a
    particular language.

    I guess I'm just not hard-core enough to hang with some of you folks.
     
    Frank Oquendo, Feb 1, 2005
    #32
  13. I did not know whether a boolean defaults to true or false but I think the code was easy enough to understand that I would make the assumption and then confirm it.

    Regards - Nathan
     
    Nathan Taylor, Feb 1, 2005
    #33
  14. Paul-de-Boer

    VBA Guest

    I guess you would also use this type of construct

    If SomeVariable = True Then

    instead of

    If SomeVariable Then
     
    VBA, Feb 1, 2005
    #34
  15. Function which returns a boolean, not a boolean. There's a difference.
     
    Frank Oquendo, Feb 1, 2005
    #35
  16. Yes, I do. Interestingly enough, I detect a hint of derision in your
    query. I too used to think such coding demonstrated my intellectual
    superiority. Funny how time and practical experience changes a perspective.
     
    Frank Oquendo, Feb 1, 2005
    #36
  17. Paul-de-Boer

    VBA Guest

    Nope, just making a point.


     
    VBA, Feb 1, 2005
    #37
  18. Okay: point for VBA.

    I surrender. Can we close this issue now?
     
    Frank Oquendo, Feb 1, 2005
    #38
  19. Paul-de-Boer

    VBA Guest

    Hey, you're the one that brought it up!


     
    VBA, Feb 1, 2005
    #39
  20. That means it is mine to drop, correct? Very well, I do so now. Thank
    you for the discussion.
     
    Frank Oquendo, Feb 1, 2005
    #40
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.