明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: nibenqiangdy

[求助]有没有如此的程序

  [复制链接]
发表于 2008-3-7 16:55:00 | 显示全部楼层
真的不知道,即然是LISP程序,为什么要用VLA来添加文字呢?你用TEXT命令不行吗?
发表于 2008-3-7 18:47:00 | 显示全部楼层

指定属性、属性参照或文字的水平和垂直对齐。 MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/idh_alignmentpointacquisition.htm">

MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/alignment_see_also.htm">参阅 | MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/ex_alignment.htm">示例

语法

object.Alignment

object

MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/idh_attribute_object.htm">Attribute, MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/idh_attributeref_object.htm">AttributeRef, MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/idh_text_object.htm">Text
使用该属性的对象。

Alignment

acAlignment 常数; 可读写

acAlignmentLeft

acAlignmentCenter

acAlignmentRight

acAlignmentAligned

acAlignmentMiddle

acAlignmentFit

acAlignmentTopLeft

acAlignmentTopCenter

acAlignmentTopRight

acAlignmentMiddleLeft

acAlignmentMiddleCenter

acAlignmentMiddleRight

acAlignmentBottomLeft

acAlignmentBottomCenter

acAlignmentBottomRight

说明

对齐到 acAlignmentLeft 的文字使用 MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/idh_insertionpoint.htm">InsertionPoint 属性来放置文字。

对齐到 acAlignmentAligned 或 acAlignmentFit 的文字同时使用 MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/idh_insertionpoint.htm">InsertionPoint 以及 MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/idh_textalignmentpoint.htm">TextAlignmentPoint 属性来放置文字。

对齐到其它任何位置的文字使用 MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/idh_textalignmentpoint.htm">TextAlignmentPoint 属性来放置文字。

MSITStore:C:\AutoCAD%202006\HELP\acadauto.chm::/img/auw0819u.gif" width="428" border="0" alt=""/>

发表于 2008-3-8 12:50:00 | 显示全部楼层

vla类的函数我怎么用不了,要加载什么东西才能用吗?

 楼主| 发表于 2008-3-10 07:36:00 | 显示全部楼层

各位高手请给予指点一下,谢谢!!!!

 楼主| 发表于 2008-3-11 15:45:00 | 显示全部楼层

各位同僚帮帮忙!

我在这儿先谢谢了!

发表于 2008-3-11 18:38:00 | 显示全部楼层

难道楼主没有看无痕版主的回复么?

;;Alignment
(defun c:test ()
  (setq *APP (vlax-get-acad-object)) ;得到程序指针
  (setq *DOC (vla-get-activedocument *App)) ;得到当前文档


  (setq *ModelSpace (vla-get-modelspace *Doc)) ;新文档的模型空间
  (setq ab "含油水层")

  (setq *textobj (vla-addtext
     *modelspace
     ab
     (vlax-3d-point (list 500 200 0))
     13
   )
  )
  (vla-put-alignment *textobj acAlignmentCenter)
  (vlax-release-object *textobj)
  (vlax-release-object *ModelSpace) ;模型空间指针释放
  (vlax-release-object *Doc)  ;释放新文档指针
)

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-6-19 13:29 , Processed in 0.154537 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表