Vla-put-insertionpoint

提供:GizmoLabs - だいたい CAD LISP なサイト
印刷用ページはサポート対象外です。表示エラーが発生する可能性があります。ブラウザーのブックマークを更新し、印刷にはブラウザーの印刷機能を使用してください。
構文
(vla-put-insertionpoint vla-object point )


機能
幾何公差、文字、ブロック、シェイプ、および OLE オブジェクトの原点(左上コーナー)の挿入点を指定する。


引数
  • vla-object … VLAオブジェクト(Attribute、AttributeReference、BlockReference、ExternalReference、MInsertBlock、MText、OLE、PointCloud、PointCloudEx、Shape、Table、Text、Tolerance)
  • point … 挿入点または原点を表す 3D WCS 座標。


戻り値
nil


  • MText : 文字境界のコーナー位置を指定する。AttachmentPoint プロパティを使用して、文字境界のどのコーナーをこの挿入点に位置付けるかを指定する。
  • Text : このプロパティは、Alignment プロパティが acAlignmentLeft、acAlignmentAligned、または acAlignmentFitに設定されている文字を除き、読み込み専用。位置合わせが、左、両端合わせ、フィット以外の場合は、TextAlignmentPoint プロパティを使用して文字の位置を決定する。


サンプル
(vl-load-com)
(defun c:Example_InsertionPoint()
    ;; テキストを作成して挿入点を変更するサンプル
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
  
    ;; テキストの定義
    (setq textString "Hello, World."
          insertionPoint (vlax-3d-point 2 2 0)
          height 0.5)

    
    ;; テキストを作成
    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq textObj (vla-AddText modelSpace textString insertionPoint height))
    (vla-ZoomAll acadObj)
    
    ;; 現在の挿入点を表示
    (setq currInsertionPoint (vlax-safearray->list (vlax-variant-value (vla-get-InsertionPoint textObj))))
    (alert (strcat "現在のテキストの挿入点は " (rtos (nth 0 currInsertionPoint) 2) ", "
                                               (rtos (nth 1 currInsertionPoint) 2) ", "
                                               (rtos (nth 2 currInsertionPoint) 2)))
    
    ;; 挿入点を変更して変更点を表示
    (setq insertionPoint (vlax-3d-point 3 3 0))
    (vla-put-insertionPoint textObj insertionPoint)
    (vla-Update textObj)
    (setq newInsertionPoint (vlax-safearray->list (vlax-variant-value (vla-get-InsertionPoint textObj))))
    (alert (strcat "新しいテキストの挿入点は  " (rtos (nth 0 newInsertionPoint) 2) ", "
                                                (rtos (nth 1 newInsertionPoint) 2) ", "
                                                (rtos (nth 2 newInsertionPoint) 2)))
)

関連事項