TroutKing Posted May 10, 2012 Share Posted May 10, 2012 Good afternoon Can someone help me figure out my plot size? I can't seem to get it to work. As you can see in the code below I've tried a few different things. I have a small program from a long time ago that will return values like "User ####". That program indicates the plot size for my particular plotter should be User 1283. (I have no clue where those values come from and regardless of which returned value that I choose my program still wont work). However, no matter what I've tried - I can't get this code to run past the CanonicalMediaLine. Any possible help? Option Explicit Public Sub SetPageLayout() 'On Error GoTo GetErr Dim pLayoutConfig As AcadLayout Set pLayoutConfig = ThisDrawing.ActiveLayout Dim PlotSize As String PlotSize = "Oce D+ 24x36 (Landscape)" 'or "User 1283" or "Oce_D_+_24x36_(Landscape)" pLayoutConfig.RefreshPlotDeviceInfo pLayoutConfig.ShowPlotStyles = False pLayoutConfig.ConfigName = "MyPLotter" pLayoutConfig.StyleSheet = MyCTBFile" pLayoutConfig.CanonicalMediaName = PlotSize ' or "Oce_D_+_24x36_(Landscape)" or "User 1283" or "Oce D+ 24x36 (Landscape)" pLayoutConfig.PaperUnits = acInches pLayoutConfig.CenterPlot = True pLayoutConfig.PlotWithPlotStyles = True ThisDrawing.ActiveLayout.PlotRotation = ac90degrees pLayoutConfig.PlotType = acExtents pLayoutConfig.StandardScale = ac1_1 pLayoutConfig.RefreshPlotDeviceInfo 'GetErr: If Err.Number <> 0 Then MsgBox (" NO IDEA WHAT HAPPENED THERE" & vbCr & "EITHER TRY AGAIN OR GO HOME AND HAVE A BEER") MsgBox " DONE" 'ThisDrawing.Save Exit_Here: End Sub Quote Link to comment Share on other sites More sharing options...
TroutKing Posted May 10, 2012 Author Share Posted May 10, 2012 Nevermind! I got it. I need to load all of the CanonicalMediaNames after I select my plotter and then the "UserXXXX" (with no spaces) works well! Thanks for looking though.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.