Open drawing

Discussion in 'AutoCAD' started by Joe Sutphin, Jul 15, 2004.

  1. Joe Sutphin

    Joe Sutphin Guest

    I have a situation where I open AutoCAD programmatically and the starts
    inserting blocks. However, when my application opens AutoCAD the blocks come
    in with the wrong LTScale. Here's what's puzzling, when I first open AutoCAD
    and then my application [the application uses GetObject in this second
    scenario] the blocks then come in with the correct LTScale. Does anyone know
    what could possibly be going on here. I'm really at a loss for an
    explanation. TIA.

    Joe
    --
     
    Joe Sutphin, Jul 15, 2004
    #1
  2. Joe Sutphin

    TomD Guest

    This will probably be a stupid question, but have checked the CELTSCALE
    variable's value before and after the insert in both scenarios?

    If so, what were the results?

    As for a solution.............if you're only trying to apply the current
    style, why not just do so after inserting it?

    eIns = ThisDrawing.ModelSpace.AddInsert
    eIns.LinetypeScale = ThisDrawing.GetVariable("CELTSCALE")

    .......please forgive any typos in that (and also for assuming that you
    hadn't considered doing this) ;)
     
    TomD, Jul 15, 2004
    #2
  3. Joe Sutphin

    Joe Sutphin Guest

    Tom,

    I'm afraid I didn't do a good job of explaining myself.

    When I first open a drawing from scratch using the Metric option and then
    run my application to inserts blocks the LTScale of the blocks is correct.

    However, if I open a session of AutoCAD through code and insert the same
    blocks my LTScales are all wrong.

    Hence, the question is really how do I start a session of AutoCAD with the
    same metric option I use when open a drawing through AutoCAD?

    Joe
    --

     
    Joe Sutphin, Jul 16, 2004
    #3
  4. Joe Sutphin

    TomD Guest

    Forgive my ingorance, Joe, but what is the 'metric option'?

    BTW: In case you didn't get my other message, using SendKeys to pass
    "{ENTER}" was an acceptable workaround to the SendCommand crashing with the
    vbCr.
     
    TomD, Jul 16, 2004
    #4
  5. Joe Sutphin

    Joe Sutphin Guest

    Tom,

    When you have Preferences set to Show traditional startup dialog" you can
    choose between Inch or Metric when starting from stratch.

    Joe
    --
     
    Joe Sutphin, Jul 16, 2004
    #5
  6. Joe Sutphin

    TomD Guest

    I don't use the startup dialog, but I was under the impression that it was
    little more than a 'wizard' type interface to different prototype drawings.
    Is it possible that you have a screwy prototype drawing?
     
    TomD, Jul 16, 2004
    #6
  7. Joe Sutphin

    Joe Sutphin Guest

    Unfortunately, I have found that through various methods, nothing works
    consistently. Sometimes the blocks come in correctly, sometimes they don't.
    There does not seem to be a clear method of guaranteeing the blocks will
    come in correctly everytime. However, thanks so much for the help. Glad you
    got your other problem fixed.

    Joe
    --
     
    Joe Sutphin, Jul 16, 2004
    #7
  8. Joe Sutphin

    TomD Guest

    If you'd like me to try anything for you, let me know. I'd be happy to
    help.

    Sorry I couldn't offer you more help.
     
    TomD, Jul 16, 2004
    #8
  9. Are you opening a drawing or inserting blocks into the default drawing?
    If the latter, have you tried the Add method of the AcadDocuments class?
    It'll allow you to specify a template.
     
    Frank Oquendo, Jul 16, 2004
    #9
  10. Joe Sutphin

    Joe Sutphin Guest

    Frank,

    Yep, tried that too. Sometimes it works, sometimes it don't. It's really
    strange cause if I open the blocks like a drawing, the LTScales are fine.
    And, it's not all the blocks just some of them.

    Joe
    --

     
    Joe Sutphin, Jul 16, 2004
    #10
  11. Joe, You might want to check the "MEASUREMENT" variable (command) to see if
    you are actually getting a metric drawing when you start programmatically.

    value of 0 is an English drawing
    value of 1 is a metric drawing

    Paul
     
    Paul Richardson, Jul 17, 2004
    #11
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.