Autocad ile Yazıcıdan Çıktı Almak

En son güncellendiği tarih: 22 Ara 2018

Autocad ile Yazıcıdan Çıktı Almak için aşağıda ki kodları kullanabilirsiniz.

Public Sub getir()

UserForm1.show

End Sub



'Aşağıdaki kodlar userform içinde olacaktır.Yukarıda ki kodlar ise Module1 içinde olacaktır.


Public Sub CommandButton1_Click()

Call çıktıal

End Sub

Public Sub SetupAndPlot(ByRef Plotter As String, CTB As String, SIZE As String, PSCALE As String, ROT As String)

Dim Layout As AcadLayout

Dim Chr As Variant

On Error GoTo Err_Control

Set Layout = ThisDrawing.ActiveLayout

Layout.RefreshPlotDeviceInfo

Layout.ConfigName = Plotter ' CALL PLOTTER

Layout.PlotType = acWindow

Layout.PlotRotation = ac270degrees ' CALL ROTATION

Layout.StyleSheet = CTB ' CALL CTB FILE

Layout.PlotWithPlotStyles = True

Layout.PlotViewportBorders = False

Layout.PlotViewportsFirst = True

Layout.CanonicalMediaName = "A4" ' CALL SIZE

Layout.PaperUnits = acMillimeters

Layout.StandardScale = PSCALE 'CALL PSCALE

Layout.ShowPlotStyles = False

ThisDrawing.Plot.NumberOfCopies = 1


Layout.CenterPlot = True

If SIZE = "ARCH_expand_C_(24.00_x_18.00_Inches)" Then

Layout.ScaleLineweights = True

End If

Set Layout = Nothing

Exit_Here:

Exit Sub

Err_Control:

Select Case Err.Number

Case "-2145320861"

MsgBox "Unable to Save Drawing- " & Err.Description

Case "-2145386493"

MsgBox "Drawing is setup for Named Plot Styles." & (Chr(13)) & (Chr(13)) & "Run CONVERTPSTYLES command", vbCritical, "Change Plot Style"

Case Else

MsgBox "Unknown Error " & Err.Number

End Select

End Sub

Public Sub çıktıal()

UserForm1.hide

Dim ad As Integer

Dim D As Integer

Dim K As Integer

Dim InsPnt As Variant

Dim point1 As Variant, point2 As Variant

Dim InsPnti(0 To 2) As Double

Dim InsPntj(0 To 2) As Double

Dim InsPnt0(0 To 2) As Double

Dim InsPnt1(0 To 2) As Double

Dim InsPntz(0 To 2) As Double 'ZOOM

Dim m As Long

Dim zoom1(0 To 2) As Double

Dim zoom2(0 To 2) As Double

Call SetupAndPlot(ComboBox1, "monochrome.ctb", "A4", acScaleToFit, ac270degrees)


InsPnt = ThisDrawing.Utility.GetPoint(, "Select an insertion point")

m = 0

D = TextBox1.Value

For K = 1 To D

'ZOOM İÇİN GEREKLİ INSERTION POINT

InsPntz(0) = InsPnt(0)

InsPntz(1) = InsPnt(1) - m

InsPntz(2) = InsPnt(2)

zoom1(0) = InsPntz(0) - 1

zoom1(1) = InsPntz(1) + 1

zoom1(2) = 0

zoom2(0) = zoom1(0) + 6302

zoom2(1) = zoom1(1) - 4457

zoom2(2) = 0

ThisDrawing.Application.ZoomWindow zoom1, zoom2

m = m + 5455

point1 = zoom1

ReDim Preserve point1(0 To 1)

point2 = zoom2

ReDim Preserve point2(0 To 1)

ThisDrawing.ActiveLayout.SetWindowToPlot point1, point2

ThisDrawing.ActiveLayout.GetWindowToPlot point1, point2

ThisDrawing.SetVariable "BACKGROUNDPLOT", 0

Dim Plot1 As DataObject

ThisDrawing.Plot.PlotToDevice

Next

Unload UserForm1

End Sub

Public Sub UserForm_Activate()

ComboBox1.AddItem "Adobe PDF"

ComboBox1.AddItem "HP LaserJet Professional P1102 (Kopya 1)"

ComboBox1.AddItem "HP LaserJet Professional P1102"

ComboBox1.AddItem "\\NIHAT\HP LaserJet Professional P1102"

End Sub


17 görüntüleme0 yorum

Son Paylaşımlar

Hepsini Gör
  • Instagram
  • Facebook Sosyal Simge
  • Pinterest Sosyal Simge
  • YouTube
Mubertrzon

mubertrzon@mubertrzon.com

Tel: 00000000000

© 2018 mubertrzon

Marmara Üniversitesi
Teknik eğitim fakültesi