Click here to Skip to main content
15,888,527 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Make a Skype for Business (S4B) from a windows form? Pin
Richard Deeming16-Feb-17 10:15
mveRichard Deeming16-Feb-17 10:15 
GeneralRe: Make a Skype for Business (S4B) from a windows form? Pin
Mycroft Holmes16-Feb-17 14:41
professionalMycroft Holmes16-Feb-17 14:41 
GeneralRe: Make a Skype for Business (S4B) from a windows form? Pin
NotPolitcallyCorrect16-Feb-17 10:17
NotPolitcallyCorrect16-Feb-17 10:17 
GeneralRe: Make a Skype for Business (S4B) from a windows form? Pin
Richard Deeming16-Feb-17 10:21
mveRichard Deeming16-Feb-17 10:21 
GeneralRe: Make a Skype for Business (S4B) from a windows form? Pin
NotPolitcallyCorrect16-Feb-17 10:28
NotPolitcallyCorrect16-Feb-17 10:28 
JokeRe: Make a Skype for Business (S4B) from a windows form? Pin
Richard Deeming16-Feb-17 10:33
mveRichard Deeming16-Feb-17 10:33 
GeneralRe: Make a Skype for Business (S4B) from a windows form? Pin
NotPolitcallyCorrect16-Feb-17 13:32
NotPolitcallyCorrect16-Feb-17 13:32 
Questionprint DWG TO PDG Pin
Member 1290459016-Feb-17 0:28
Member 1290459016-Feb-17 0:28 
Hello,
Please help me to solve this problem. I tried to make a code to save a dwg file in pdf form.
These mesag of error belongs to me
AcadPlot: Not defined
AcadPlotConfigurations: type AcadPlotConfigurations no defined
AcPlotScale: AcPlotScale name not declared
Below the code:
 
 
Module Mdl_Print
Public Sub PDF_Print()
'Dim AutoCAD As Object
Dim AcadApp As Object
Dim AcadDoc As Object
Dim dirInfo As New DirectoryInfo(Frm_Main.LblFolder1.Text)
Dim fileInfo As FileInfo
Dim AcadApp As AcadApplication = New AcadApplication
AcadApp.Visible = True
AcadApp.WindowState = AcWindowState.acMax
Dim success As Boolean = False

For Each fileInfo In dirInfo.GetFiles("*.dwg") 'dwg for Autocad
AcadDoc = AcadApp.Documents.Open(fileInfo.FullName)

Dim oSS As AcadSelectionSet
oSS = AcadApp.ActiveDocument.SelectionSets.Add("oSS")
oSS.Clear()

Try
Dim ftype(0) As Int16
Dim fdata(0) As Object
ftype(0) = 410 'layout
fdata(0) = "A3 - ENGLISH"
oSS.Select(AcSelect.acSelectionSetAll, , , ftype, fdata)
Dim objPrefFiles As AcadPreferencesFiles
Dim PC3PathOld As String
Dim PC3PathNew As String
Dim PMPPathOld As String
Dim PMPPathNew As String
Dim PtConfigs As AcadPlotConfigurations
Dim PlotConfig As AcadPlotConfiguration
Dim PtObj As AcadPlot
Dim BackPlot As Object
'Set the preferences object
objPrefFiles = AcadDoc.Application.Preferences.Files
'Get the current Printer Config Path (pc3)
PC3PathOld = objPrefFiles.PrinterConfigPath
MessageBox.Show(PC3PathOld, "old Printer Config path (pc3)")
objPrefFiles.PrinterConfigPath = "C:\Users\ROBERT\Documents\Deb + Herve + Will\B - Herve\Technip\Autocad\1st project\OpenExcel\PC3 Files"
PC3PathNew = objPrefFiles.PrinterConfigPath
MessageBox.Show(PC3PathNew, "new Printer Config path (pc3)")
'Get the current Printer Desc Path (pmp)
PMPPathOld = objPrefFiles.PrinterDescPath
MessageBox.Show(PMPPathOld, "Printer Desc Path (pmp)")
objPrefFiles.PrinterDescPath = "C:\Users\ROBERT\Documents\Deb + Herve + Will\B - Herve\Technip\Autocad\1st project\OpenExcel\PMP Files"
PMPPathNew = objPrefFiles.PrinterDescPath
MessageBox.Show(PMPPathNew, "Printer Desc Path (pmp)")
 
PtObj = AcadDoc.Plot
AcadApp.ActiveDocument.AcPlotType.acExtents()
PtConfigs = AcadDoc.PlotConfigurations
''Add a new plot configuration
PtConfigs.Add("PDF", False)
'
''The plot config you created become active
PlotConfig = PtConfigs.Item("PDF")
''Use this method to set the scale
PlotConfig.StandardScale = AcPlotScale.acScaleToFit
''Updates the plot
PlotConfig.RefreshPlotDeviceInfo()
'Here you specify the pc3 file you want to use
PlotConfig.ConfigName = "Herve.pc3"
'You can select the plot style table here
PlotConfig.StyleSheet = "monochrome.ctb"
'You can select the Scale Line Weight
PlotConfig.ScaleLineweights = True
'Specifies Paper Size
PlotConfig.CanonicalMediaName = "ISO_A4_(210.00_x_297.00_MM)"
'Specifies whether or not to plot using the plot styles
PlotConfig.PlotWithPlotStyles = True
BackPlot = AcadDoc.GetVariable("BACKGROUNDPLOT")
AcadDoc.SetVariable("BACKGROUNDPLOT", 0)
'Updates the plot
PlotConfig.RefreshPlotDeviceInfo()
MessageBox.Show("scale" & PlotConfig.StandardScale)
MessageBox.Show("canonical media name" & PlotConfig.CanonicalMediaName)
MessageBox.Show("config name" & PlotConfig.ConfigName)
MessageBox.Show("plot type" & PlotConfig.PlotType)
MessageBox.Show("scale line weight" & PlotConfig.ScaleLineweights)
'Now you can use the PlotTofile method
If PtObj.PlotToFile(Replace(AcadDoc.FullName, "dwg", "pdf"), PlotConfig.ConfigName) Then
AcadDoc.Utility.Prompt(vbLf + "PDF Was Created")
Else
AcadDoc.Utility.Prompt(vbLf + "PDF Creation Unsuccessful")
End If
'If you wish you can delete the plot configuration you created programmatically, and set the 'BACKGROUNDPLOT' system variable to its original status.
PtConfigs.Item("PDF").Delete()
PlotConfig = Nothing
AcadDoc.SetVariable("BACKGROUNDPLOT", BackPlot)
objPrefFiles.PrinterConfigPath = "C:\Users\ROBERT\AppData\Roaming\Autodesk\AutoCAD 2014\R19.1\enu\Plotters"
objPrefFiles.PrinterDescPath = "C:\Users\ROBERT\AppData\Roaming\Autodesk\AutoCAD 2014\R19.1\enu\Plotters\PMP File"
oSS.Clear()
If AcadDoc.Saved Then
AcadDoc.Close(False)
End If
AcadDoc = Nothing
AcadApp.Quit()
AcadApp = Nothing
success = True
Catch ex As Exception
MsgBox(ex.Message + vbLf + ex.StackTrace)
success = False
End Try
' AcadDoc.Close()
AcadDoc = Nothing
' AcadApp.Quit()
Next
AcadApp.Quit()
End Sub
End Module

AnswerRe: print DWG TO PDG Pin
Jochen Arndt16-Feb-17 1:15
professionalJochen Arndt16-Feb-17 1:15 
Questionvb.net 2012 resource file is missing Pin
dcof14-Feb-17 8:47
dcof14-Feb-17 8:47 
AnswerRe: vb.net 2012 resource file is missing Pin
Richard Deeming14-Feb-17 9:36
mveRichard Deeming14-Feb-17 9:36 
GeneralRe: vb.net 2012 resource file is missing Pin
dcof14-Feb-17 12:11
dcof14-Feb-17 12:11 
GeneralRe: vb.net 2012 resource file is missing Pin
Dave Kreskowiak14-Feb-17 13:53
mveDave Kreskowiak14-Feb-17 13:53 
AnswerRe: vb.net 2012 resource file is missing Pin
NotPolitcallyCorrect14-Feb-17 11:13
NotPolitcallyCorrect14-Feb-17 11:13 
AnswerRe: vb.net 2012 resource file is missing Pin
sa'd saud13-Jun-21 4:41
sa'd saud13-Jun-21 4:41 
Questionvb6 - invalid property array index Pin
jhovyn12-Feb-17 20:59
jhovyn12-Feb-17 20:59 
AnswerRe: vb6 - invalid property array index Pin
Mycroft Holmes12-Feb-17 21:29
professionalMycroft Holmes12-Feb-17 21:29 
AnswerRe: vb6 - invalid property array index Pin
Ralf Meier12-Feb-17 21:54
mveRalf Meier12-Feb-17 21:54 
GeneralRe: vb6 - invalid property array index Pin
Richard Deeming13-Feb-17 1:17
mveRichard Deeming13-Feb-17 1:17 
AnswerRe: vb6 - invalid property array index Pin
Richard Deeming13-Feb-17 1:22
mveRichard Deeming13-Feb-17 1:22 
Questionvb.net, Linq, use or where and or and contains Pin
jkirkerx10-Feb-17 11:25
professionaljkirkerx10-Feb-17 11:25 
AnswerRe: vb.net, Linq, use or where and or and contains [solved] Pin
jkirkerx10-Feb-17 11:35
professionaljkirkerx10-Feb-17 11:35 
GeneralRe: vb.net, Linq, use or where and or and contains [solved] Pin
Richard Deeming12-Feb-17 2:04
mveRichard Deeming12-Feb-17 2:04 
GeneralRe: vb.net, Linq, use or where and or and contains [solved] Pin
jkirkerx13-Feb-17 6:30
professionaljkirkerx13-Feb-17 6:30 
QuestionLine in Volume control! Pin
User 98970748-Feb-17 7:54
User 98970748-Feb-17 7:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.