Vla-put-attachmentpoint

提供:GizmoLabs - だいたい CAD LISP なサイト
構文
(vla-put-attachmentpoint vla-object point )


機能
マルチ テキスト オブジェクトの位置決め点を指定する。


引数
  • vla-object … MText のVLAオブジェクト
  • point … acAttachmentPoint 列挙型
  • acAttachmentPointTopLeft
  • acAttachmentPointTopCenter
  • acAttachmentPointTopRight
  • acAttachmentPointMiddleLeft
  • acAttachmentPointMiddleCenter
  • acAttachmentPointMiddleRight
  • acAttachmentPointBottomLeft
  • acAttachmentPointBottomCenter
  • acAttachmentPointBottomRight


戻り値
nil


  • MEMO:アタッチ点は挿入点を文字境界と位置合わせする場所を指定する。選択したオプションにより、文字揃えと文字境界内の文字の配置が決まる。位置合わせのオプションは、Left、Right、Center。文字配置のオプションは、Top、Mid、Bottom。
  • AttachmentPoint プロパティが変更された場合、既存の境界ボックスの位置は変わらず、文字が境界ボックス内で単純に再度位置合わせされる。ただし、InsertionPoint プロパティは使用されているアタッチ点の座標を反映するので、位置合わせの変化を反映して InsertionPoint プロパティの値が変わる。


サンプル
(vl-load-com)
(defun c:Example_AttachmentPoint()
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (setq corner (vlax-3d-point 3 3 0)  
          width 10
          text "Hello, World.")
  
    ;; MText オブジェクトを作成
    (setq modelSpace (vla-get-ModelSpace doc))  
    (setq MTextObj (vla-AddMText modelSpace corner width text))
  
    (setq count 1)
    (repeat 9
        (vla-put-AttachmentPoint MTextObj count)

        ;; 位置合わせ点
        (cond
            ((= (vla-get-AttachmentPoint MTextObj) 1)(setq attachPoint "TopLeft"))
            ((= (vla-get-AttachmentPoint MTextObj) 2)(setq attachPoint "TopCenter"))
            ((= (vla-get-AttachmentPoint MTextObj) 3)(setq attachPoint "TopRight"))
            ((= (vla-get-AttachmentPoint MTextObj) 4)(setq attachPoint "MiddleLeft"))
            ((= (vla-get-AttachmentPoint MTextObj) 5)(setq attachPoint "MiddleCenter"))
            ((= (vla-get-AttachmentPoint MTextObj) 6)(setq attachPoint "MiddleRight"))
            ((= (vla-get-AttachmentPoint MTextObj) 7)(setq attachPoint "BottomLeft"))
            ((= (vla-get-AttachmentPoint MTextObj) 8)(setq attachPoint "BottomCenter"))
            ((= (vla-get-AttachmentPoint MTextObj) 9)(setq attachPoint "BottomRight"))
        )

        (vla-Regen doc :vlax-true)
        (alert (strcat "MText の位置合わせ点は : " attachPoint))

        (setq count (1+ count))
    )
)



関連事項