.StyleSheet and .ConfigName question

Discussion in 'AutoCAD' started by Miles, Apr 6, 2004.

  1. Miles

    Miles Guest

    If a layout has the PC3 and CTB assigned to None, I use this code to assign
    a "default" value.

    Dim objLayout As AcadLayout
    Set objLayout = ThisDrawing.ActiveLayout
    If objLayout.configName = "None" Then
    objLayout.configName = "CLASER.pc3"
    objLayout.StyleSheet = "CLASER.ctb"
    objLayout.RefreshPlotDeviceInfo
    End If

    If you look at the Pagesetup dialog after the code is run, both values are
    set, however the Plot Preview still "looks" like it has None applied.

    If you select THE SAME EXACT PC3 and CTB from the Pagesetup dialog, press
    OK, the changes are applied.
    Is there a "force" save or refresh option that I am missing ?

    Thanks.
     
    Miles, Apr 6, 2004
    #1
  2. Here's how I got Margins to update after I changed them in my project... it
    may also work for yours. It does occasionally send the ENTER key into the
    ether (I think it's when the user runs the macro and then hits keys while
    it's running) but if the user hits the OK button in the PageSetup box
    themselves the macro continues on as intended... if you need something more
    professional, this isn't your answer.

    ' ENTER key sent again to the following page setup dialog box
    ' this allows the page setup changes to "take"
    SendKeys "{ENTER}"
    curDwg.SendCommand ("pagesetup" & vbCr) 'ThisDrawing...
     
    James Belshan, Apr 7, 2004
    #2
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.