Results 1 to 4 of 4

Thread: CanonicalMediaName with Autocad 2006

  1. #1
    Member
    Join Date
    2002-08
    Posts
    7
    Login to Give a bone
    0

    Default CanonicalMediaName with Autocad 2006

    Hy,

    I am a french user and I have search through all forum that I know,
    but I don't find how to set paper size for a layout.

    All exemple that i find not work in 2006.

    Daniel OLIVES
    Lyon, France

  2. #2
    I could stop if I wanted to
    Join Date
    2002-02
    Location
    Kansas
    Posts
    487
    Login to Give a bone
    0

    Default Re: CanonicalMediaName with Autocad 2006

    go the the layout then right click the tab and select page set set up set pager size: in the layout settings tab. done

    or use the command _.Pagesetup

  3. #3
    Member
    Join Date
    2002-08
    Posts
    7
    Login to Give a bone
    0

    Default Re: CanonicalMediaName with Autocad 2006

    Hy,
    I find something useful in this thread !

    http://discussion.autodesk.com/threa...sageID=5102204

    Now I know all paper user code :

    "User -1" , "User -2" , "Users 257" etc with plotter HP750C

    But is it possible to thind somethong more useful that give
    the name "Pers. 1: A0++" in place of "User 257" ?

    Then I can put the paper size by code !
    This is useful because when I recieve a drawing from an other office,
    I can put automaticaly the correct plotter and size and vue.

    Daniel OLIVES
    Lyon, France

  4. #4
    Member
    Join Date
    2002-08
    Posts
    7
    Login to Give a bone
    0

    Default Re: CanonicalMediaName with Autocad 2006

    Hy, it's me again !

    Just a part of the code :

    Code:
        Dim objPresentation As AcadLayout
        Dim objPlotDevices As Variant
        Dim x As Integer
        Dim TestPresentationResultat As Integer
        Dim strobjPlotDevices As String, strpos As Variant, strtemp As String
        Dim strobjPresConfName As Variant
        
        Set objPresentation = ThisDrawing.PaperSpace.layout
        
        ' Collection des "Layouts" (Présentations) du dessin courant
        ' et liste les infos de base.
        Dim Layouts As AcadLayouts
        
        ' Get layouts collection from document object
        Set Layouts = ThisDrawing.Layouts
     
        ' Rafraichis les informations des imprimantes
        objPresentation.RefreshPlotDeviceInfo
        objPlotDevices = objPresentation.GetPlotDeviceNames()
        If Left(ThisDrawing.Name, 6) <> "Dessin" Then
        For Each objPresentation In ThisDrawing.Layouts
            If UCase(objPresentation.Name) <> UCase("Model") Then
                TestPresentationResultat = 0
                For x = LBound(objPlotDevices) To UBound(objPlotDevices)
     
                    If InStr(objPlotDevices(x), "\") > 0 Then
                        intPos = InStrRev(objPlotDevices(x), "\") + 1
                        strtemp = Mid$(objPlotDevices(x), intPos)
                        strobjPlotDevices = strtemp
                    Else
                        ' Invalid path submitted so return 0.
                        strobjPlotDevices = objPlotDevices(x)
                    End If
                    
                    If InStr(objPresentation.ConfigName, "\") > 0 Then
                        intPos = InStrRev(objPresentation.ConfigName, "\") + 1
                        strtemp = Mid$(objPresentation.ConfigName, intPos)
                        strobjPresConfName = strtemp
                    Else
                        ' Invalid path submitted so return 0.
                        strobjPresConfName = objPresentation.ConfigName
                    End If
                    
                    If strobjPlotDevices = strobjPresConfName Then
    '                    Configuration connue !
                        TestPresentationResultat = 1
                    End If
                Next
                ' Remplace l'ancien traceur "PDF995" avec ou sans extension
                If TestPresentationResultat = 0 And _
                        (UCase(strobjPresConfName) = "PDF995" Or UCase(strobjPresConfName) = "PDF995.PC3") Then
                    objPresentation.ConfigName = "TraceurLyon1.pc3"
                    objPresentation.CanonicalMediaName = "User257"
                    objPresentation.SetCustomScale 1, 1
                    objPresentation.PlotRotation = ac90degrees
                    objPresentation.PaperUnits = acMillimeters
                    TestPresentationResultat = 1
                End If
                ' Remplace le traceur Toulouse "REPROCOLOR" avec ou sans extension
                If TestPresentationResultat = 0 And _
                        (UCase(strobjPresConfName) = "REPROCOLOR" Or UCase(strobjPresConfName) = "REPROCOLOR.PC3") Then
                    objPresentation.ConfigName = "TraceurLyon1.pc3"
                    objPresentation.CanonicalMediaName = "User257"
                    TestPresentationResultat = 1
                End If
                If TestPresentationResultat = 0 Then
                    MsgBox "Il n'y a pas d'imprimante pour cette présentation : " & _
                            objPresentation.Name
                End If
            End If
        Next
        End If
    End Sub
    [ Moderator Action = ON ] What are [ CODE ] tags... [ Moderator Action = OFF ]
    Last edited by Opie; 2006-06-20 at 08:46 PM. Reason: [CODE] tags added, see moderator comment

Similar Threads

  1. Benchmark AutoCAD 2006 / ADT 2006
    By jake321 in forum CAD Management - General
    Replies: 4
    Last Post: 2006-11-13, 07:24 PM
  2. Replies: 4
    Last Post: 2006-05-16, 05:08 PM
  3. 3D Tutorial For AutoCAD 2006 or ADT 2006 ?
    By omorah in forum ACA General
    Replies: 2
    Last Post: 2006-01-19, 10:54 PM
  4. Running Map 3D 2006 as AutoCAD 2006
    By paul.lloydsmith in forum AutoCAD Map 3D - General
    Replies: 4
    Last Post: 2005-08-25, 04:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •