「Vla-put-printerstylesheetpath」の版間の差分

提供:GizmoLabs - だいたい CAD LISP なサイト
(ページの作成:「{{AutoLISP}} ; 構文 : (vla-put-printerstylesheetpath ''vla-object'' ''path'') ; 機能 : プリンタ スタイル シート ファイルの位置を指定する。 ...」)
 
(相違点なし)

2015年1月12日 (月) 02:22時点における最新版

構文
(vla-put-printerstylesheetpath vla-object path)


機能
プリンタ スタイル シート ファイルの位置を指定する。


引数
  • vla-object … PreferencesFilesのVLAオブジェクト
  • path … パスの文字列


戻り値
nil
  • 注意: セミコロン(;)を使用して複数のフォルダを区切る。ただし、文字列の最後にセミコロンは不要
サンプル
(vl-load-com)
(defun c:Example_PrinterStyleSheetPath()
    ;; プリンタ スタイル シート ファイルの位置を取得・設定するサンプル
    (setq acadObj (vlax-get-acad-object))
    (setq preferences (vla-get-Preferences acadObj))
    
    ;; 現在の設定を取得
    (setq originalValue (vla-get-PrinterStyleSheetPath (vla-get-Files preferences)))
    (alert (strcat "現在のプリンタスタイルシートパス : " originalValue))

    ;; パスを "C:\\" に変更
    (vla-put-PrinterStyleSheetPath (vla-get-Files preferences) "C:\\temp\\")
    (setq newValue (vla-get-PrinterStyleSheetPath (vla-get-Files preferences)))
    (alert (strcat "新しいプリンタ スタイル シートパス : " newValue))

    ;; リセッット
    (vla-put-PrinterStyleSheetPath (vla-get-Files preferences) originalValue)
    (alert (strcat "プリンタ スタイル シートパスを元の戻す: " originalValue))
)

関連事項