大家好
我创建了一个布局,插入了一个drawingborder和一个视口。我还更改了视口中的视图。对于反视口,我还想做一件事;将着色打印设置为“隐藏”。
这是vba;
- Dim newPViewport As AcadPViewport
- Dim center0(0 To 2) As Double
- Dim center1(0 To 2) As Double
- Dim center2(0 To 2) As Double
- Dim center3(0 To 2) As Double
- Dim width As Double
- Dim height As Double
- center0(0) = -110: center0(1) = 115.25: center0(2) = 0
- center1(0) = -110: center1(1) = 229.75: center1(2) = 0
- center2(0) = -310: center2(1) = 115.25: center2(2) = 0
- center3(0) = -310: center3(1) = 229.75: center3(2) = 0
- width = 200
- height = 114.5
- DWG_NameFull = ThisDrawing.Name
- DWG_Name = Replace(DWG_NameFull, ".dwg", "")
- ThisDrawing.ActiveSpace = acPaperSpace
- ThisDrawing.SendCommand ("layout" & vbCr & "r" & vbCr & vbCr & DWG_Name & vbCr)
- Dim Logo As AcadBlockReference
- Dim Kader As AcadBlockReference
- Dim DynProps As Variant
- Dim Variabelen As AcadDynamicBlockReferenceProperty
- Dim I As Integer
- Dim insertionPnt(0 To 2) As Double
- insertionPnt(0) = 0#: insertionPnt(1) = 0#: insertionPnt(2) = 0#
- Set Logo = ThisDrawing.PaperSpace.InsertBlock(insertionPnt, "GEALOGO", 1#, 1#, 1#, 0#)
- Set Kader = ThisDrawing.PaperSpace.InsertBlock(insertionPnt, "KADER", 1#, 1#, 1#, 0#)
- If Kader.IsDynamicBlock Then
- DynProps = Kader.GetDynamicBlockProperties
- For I = 0 To UBound(DynProps)
- Set Variabelen = DynProps(I)
- If Variabelen.Value = "A3" Then
- Variabelen.Value = Formaat
- Exit For
- End If
- Next
- End If
- ThisDrawing.ActiveLayout.RefreshPlotDeviceInfo
- ThisDrawing.ActiveLayout.ConfigName = "DWFx ePlot.pc3"
- ThisDrawing.ActiveLayout.StyleSheet = "GEA-kleur-diktes.ctb"
- ThisDrawing.ActiveLayout.PlotType = acExtents
- ThisDrawing.ActiveLayout.CenterPlot = True
- ThisDrawing.ActiveLayout.StandardScale = acScaleToFit
- AutoCAD.Update
- curpapersizes = ThisDrawing.PaperSpace.Layout.GetCanonicalMediaNames()
- ThisDrawing.Regen (acActiveViewport)
- Dim G_sht_frm As String
- G_sht_frm = "UserDefinedMetric (420.00 x 297.00MM)"
- ThisDrawing.ActiveLayout.CanonicalMediaName = G_sht_frm
- ThisDrawing.ActiveLayout.PlotRotation = plotrot
- ThisDrawing.Regen (acAllViewports)
- AutoCAD.ZoomAll
- Dim Layer As AcadLayer
- Set Layer = ThisDrawing.Layers.Add("Viewport")
- Layer.color = acMagenta
- Layer.Plottable = False
- ThisDrawing.ActiveLayer = ThisDrawing.Layers.Item("Viewport")
- Set newPViewport = ThisDrawing.PaperSpace.AddPViewport(center0, width, height)
- newPViewport.Display (True)
- [color=red]newPViewport.VisualStyle = 3[/color]
- ThisDrawing.MSpace = True
- ThisDrawing.ActivePViewport = newPViewport
- ThisDrawing.SendCommand ("-view" & vbCr & "Right" & vbCr)
- ThisDrawing.SendCommand ("pspace" & vbCr)
- ThisDrawing.Regen acAllViewports
- Call VBA.Unload(Me)
如您所见,我已将添加的视口视觉样式设置为3(隐藏?)。标准值为1(如图所示?)。在vba中,本地更改为3。但在autoCAD中,着色打印仍然是“显示的”。
在autoCAD的VBA帮助下,我无法理解螺旋的含义并将其应用于我的问题。
谁能告诉我为什么阴影图没有改变,怎么做?
thnx很多 |