寸法スタイル、レイアウト、または印刷環境設定の設定をコピーします。
サポートされているプラットフォーム: Windows のみ
VBA:
object.CopyFrom SourceObject
タイプ: DimStyle、Layout、PlotConfiguration
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: DimStyle、Dim3PointAngular、DimAligned、DimAngular、DimArcLength、DimDiametric、DimOrdinate、DimRadial、DimRadialLarge、DimRotated、Document、Layout、Leader、PlotConfiguration
コピーするソース オブジェクト。
Layout および PlotConfiguration: ソース オブジェクトは PlotConfiguration オブジェクトでなければなりません。
DimStyle: ソース オブジェクトは、DimStyle、Document、Dim3PointAngular、DimAligned、DimAngular、DimArcLength、DimDiametric、DimOrdinate、DimRadial、DimRadialLarge、DimRotated、Leader のいずれかでなければなりません。
戻り値はありません。
DimStyle: このメソッドでは、寸法スタイル データを 3 種類のソースから既存の寸法スタイルにコピーすることができます。
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)) ) ) )