.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create pc3 File from acad

3 REPLIES 3
Reply
Message 1 of 4
Human.Man.Name=Jose
668 Views, 3 Replies

Create pc3 File from acad

Does anyone know how to use the PlottingServices.PlotConfig.SaveToPc3() Method?
Been trying all day and have not had any result.

Try
For Each P As Autodesk.AutoCAD.PlottingServices.PlotConfigInfo In Autodesk.AutoCAD.PlottingServices.PlotConfigManager.Devices
Try
Dim oEditor As Autodesk.AutoCAD.EditorInput.Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
If P.DeviceName.EndsWith(".pc3") = False Then
If Not P.DeviceName = "None" Then
'oEditor.WriteMessage("Now Updating Pagesetups for all layouts referencing " + P.DeviceName + vbNewLine)
Autodesk.AutoCAD.PlottingServices.PlotConfigManager.SetCurrentConfig(P.DeviceName.ToString)
Dim oPlotConfig As Autodesk.AutoCAD.PlottingServices.PlotConfig = Autodesk.AutoCAD.PlottingServices.PlotConfigManager.CurrentConfig
'Application.ShowAlertDialog(Autodesk.AutoCAD.PlottingServices.PlotConfigManager.Devices)
'Application.ShowAlertDialog(oPlotConfig.CanonicalMediaNames(0))
Dim Fullnamepc3 As String() = oPlotConfig.DeviceName.Split("\")
Dim pc3name As String
If Fullnamepc3.Length > 0 Then
pc3name = Fullnamepc3(Fullnamepc3.GetUpperBound(0)) + ".pc3"
oPlotConfig.SaveToPC3(pc3name)
Application.ShowAlertDialog(pc3name)
End If
oPlotConfig = Nothing
oEditor = Nothing
End If
End If
Catch ex As Exception
If Not P.DeviceName = "None" Then
Application.ShowAlertDialog("Please contact IT Department and request " + P.DeviceName + " printer driver installation.")
End If
End Try
Next
Catch ex As Exception
Application.ShowAlertDialog(ex.Data)
Finally
End Try
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Human.Man.Name=Jose

when you debug, how far does it get?
Does the p3c anme get constructed correctly?

Human.Man.Name=Jose <>
|>Does anyone know how to use the PlottingServices.PlotConfig.SaveToPc3() Method?
|>Been trying all day and have not had any result.
|>
|>Try
|> For Each P As Autodesk.AutoCAD.PlottingServices.PlotConfigInfo In Autodesk.AutoCAD.PlottingServices.PlotConfigManager.Devices
|> Try
|> Dim oEditor As Autodesk.AutoCAD.EditorInput.Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor
|> If P.DeviceName.EndsWith(".pc3") = False Then
|> If Not P.DeviceName = "None" Then
|> 'oEditor.WriteMessage("Now Updating Pagesetups for all layouts referencing " + P.DeviceName + vbNewLine)
|> Autodesk.AutoCAD.PlottingServices.PlotConfigManager.SetCurrentConfig(P.DeviceName.ToString)
|> Dim oPlotConfig As Autodesk.AutoCAD.PlottingServices.PlotConfig = Autodesk.AutoCAD.PlottingServices.PlotConfigManager.CurrentConfig
|> 'Application.ShowAlertDialog(Autodesk.AutoCAD.PlottingServices.PlotConfigManager.Devices)
|> 'Application.ShowAlertDialog(oPlotConfig.CanonicalMediaNames(0))
|> Dim Fullnamepc3 As String() = oPlotConfig.DeviceName.Split("\")
|> Dim pc3name As String
|> If Fullnamepc3.Length > 0 Then
|> pc3name = Fullnamepc3(Fullnamepc3.GetUpperBound(0)) + ".pc3"
|> oPlotConfig.SaveToPC3(pc3name)
|> Application.ShowAlertDialog(pc3name)
|> End If
|> oPlotConfig = Nothing
|> oEditor = Nothing
|> End If
|> End If
|> Catch ex As Exception
|> If Not P.DeviceName = "None" Then
|> Application.ShowAlertDialog("Please contact IT Department and request " + P.DeviceName + " printer driver installation.")
|> End If
|> End Try
|> Next
|> Catch ex As Exception
|> Application.ShowAlertDialog(ex.Data)
|> Finally
|> End Try
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
Message 3 of 4

I constructed the name of the file just fine. I spent some time looking at the object arx sdk and discovered that the method takes the entire qualified path and filename. I was only giving it a name. After I included the path it all works just fine.
Message 4 of 4
Anonymous
in reply to: Human.Man.Name=Jose

slick, thanks for the code then 🙂

Human.Man.Name=Jose <>
|>I constructed the name of the file just fine. I spent some time looking at the object arx sdk and discovered that the method takes the entire qualified path and filename. I was only giving it a name. After I included the path it all works just fine.
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost