Copies the settings for a dimension style, layout, or plot configuration.
Supported platforms: Windows only
VBA:
object.CopyFrom SourceObject
Type: DimStyle, Layout, PlotConfiguration
The objects this method applies to.
Access: Input-only
Type: DimStyle, Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, Document, Layout, Leader, PlotConfiguration
The source object to be copied.
Layout and PlotConfiguration: The source object must be a PlotConfiguration object.
DimStyle: The source object must be either a DimStyle, Document, Dim3PointAngular, DimAligned, DimAngular, DimArcLength, DimDiametric, DimOrdinate, DimRadial, DimRadialLarge, DimRotated, or Leader.
No return value.
DimStyle: This method allows users to copy dimension style data into an existing dimension style from three different types of sources.
VBA:
Sub Example_CopyFrom()
' This example will create two new plot configurations, NewPC1 and NewPC2, and will use
' the CopyFrom method to duplicate the settings in the first plot configuration
' to the second plot configuration.
Dim PlotConfigurations As AcadPlotConfigurations
Dim PlotConfiguration As AcadPlotConfiguration
Dim NewPC1 As AcadPlotConfiguration, NewPC2 As AcadPlotConfiguration
' Get PlotConfigurations collection from document object
Set PlotConfigurations = ThisDrawing.PlotConfigurations
' Add NewPC1 and customize some of the properties
Set NewPC1 = PlotConfigurations.Add("NEW_CONFIGURATION1")
NewPC1.PlotRotation = ac270degrees
NewPC1.PlotHidden = True
NewPC1.PaperUnits = acMillimeters
' Add NewPC2 and leave default values intact
Set NewPC2 = PlotConfigurations.Add("NEW_CONFIGURATION2")
' Show NewPC2 settings before we copy information from NewPC1
GoSub VIEWPC2SETTINGS
' Copy setting information from NewPC1 to NewPC2
NewPC2.CopyFrom NewPC1
NewPC2.name = "NEW_CONFIGURATION2"
' Show NewPC2 settings after we copy information from NewPC1
GoSub VIEWPC2SETTINGS
Exit Sub
VIEWPC2SETTINGS:
MsgBox "The settings for NEW_CONFIGURATION2 are: " & vbCrLf & _
"Plot Rotation: " & NewPC2.PlotRotation & vbCrLf & _
"Plot Hidden: " & NewPC2.PlotHidden & vbCrLf & _
"Paper Units: " & NewPC2.PaperUnits
Return
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_CopyFrom()
;; This example will create two new plot configurations, NewPC1 and NewPC2, and will use
;; the CopyFrom method to duplicate the settings in the first plot configuration
;; to the second plot configuration.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Get PlotConfigurations collection from document object
(setq PlotConfigurations (vla-get-PlotConfigurations doc))
;; Add NewPC1 and customize some of the properties
(setq NewPC1 (vla-Add PlotConfigurations "NEW_CONFIGURATION1"))
(vla-put-PlotRotation NewPC1 ac270degrees)
(vla-put-PlotHidden NewPC1 :vlax-true)
(vla-put-PaperUnits NewPC1 acMillimeters)
;; Add NewPC2 and leave default values intact
(setq NewPC2 (vla-Add PlotConfigurations "NEW_CONFIGURATION2"))
;; Show NewPC2 settings before we copy information from NewPC1
(alert (strcat "The settings for NEW_CONFIGURATION2 are: "
"\nPlot Rotation: " (itoa (vla-get-PlotRotation NewPC2))
"\nPlot Hidden: " (if (= (vla-get-PlotHidden NewPC2) :vlax-true) "True" "False")
"\nPaper Units: " (itoa (vla-get-PaperUnits NewPC2))
)
)
;; Copy setting information from NewPC1 to NewPC2
(vla-CopyFrom NewPC2 NewPC1)
(vla-put-Name NewPC2 "NEW_CONFIGURATION2")
;; Show NewPC2 settings after we copy information from NewPC1
(alert (strcat "The settings for NEW_CONFIGURATION2 are: "
"\nPlot Rotation: " (itoa (vla-get-PlotRotation NewPC2))
"\nPlot Hidden: " (if (= (vla-get-PlotHidden NewPC2) :vlax-true) "True" "False")
"\nPaper Units: " (itoa (vla-get-PaperUnits NewPC2))
)
)
)