找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 2608|回复: 14

[精彩文萃] New and Changed AutoLISP Functions Reference (AutoLISP)

[复制链接]

已领礼包: 1268个

财富等级: 财源广进

发表于 2013-8-7 21:54:47 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
New and Changed AutoLISP Functions Reference (AutoLISP)





The following outlines the additions and changes made to AutoLISP.
AutoCAD 2014New
  • findtrustedfile - Searches the AutoCAD trusted file paths for the specified file.

Changes
  • findfile - Searches the AutoCAD support and trusted file paths. Function was updated to search the new trusted applications paths.


AutoCAD 2013New
  • vlax-machine-product-key - Returns the AutoCAD Windows registry path in the HKLM (HKEY_LOCAL_MACHINE).

Obsolete
  • vlax-product-key - Returns the AutoCAD Windows registry path.


AutoCAD 2012New
  • command-s - Executes an AutoCAD command and the supplied input.
  • *pop-error-mode* - Error-handling function that ends the previous call to*push-error-using-command* or *push-error-using-stack*.
  • *push-error-using-command* - Error-handling function that indicates the use of the command function within a custom *error* handler.
  • *push-error-using-stack* - Error-handling function that indicates the use of variables from the AutoLISP stack within a custom *error* handler.


AutoCAD 2011New
  • dumpallproperties - Retrieves an entity’s supported properties.
  • getpropertyvalue - Returns the current value of an entity’s property.
  • ispropertyreadonly - Returns the read-only state of an entity’s property.
  • setpropertyvalue - Sets the property value for an entity.


AutoCAD 2010Changes
  • help - Invokes the Help facility. Function was updated to add support for HTML documentation.


AutoCAD 2009New
  • initcommandversion - Forces the next command to run with the specified version.




评分

参与人数 1D豆 +5 收起 理由
xshrimp + 5

查看全部评分

论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 1268个

财富等级: 财源广进

 楼主| 发表于 2013-8-7 21:56:03 | 显示全部楼层
getpropertyvalue (AutoLISP)





Returns the current value of an entity’s property.
(getpropertyvalue   ename propertyname [or collectionName index name])
Arguments
ename
Name of the entity being queried. The ename can refer to either a graphical or a non-graphical entity.

propertyname
Name of the property being queried. For a list of all the valid property names of a given object, use dumpallproperties.

collectionNameIf the object is a collection object, the Collection name is passed here.
indexThe collection index being queried.
nameThe name of the property within the collection being queried.
Return Values
The value of the entity’s property.
Examples
The following example demonstrates how to get the current radius value of a circle.
Command: (command "_circle" "2,2" 2)nilCommand: (getpropertyvalue (entlast) "radius")2.0


论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 1268个

财富等级: 财源广进

 楼主| 发表于 2013-8-7 21:56:37 | 显示全部楼层
dumpallproperties (AutoLISP)





Retrieves an entity’s supported properties.
(dumpallproperties   ename [context])
Arguments
ename
Name of the entity being queried. The ename can refer to either a graphical or non-graphical entity.

context
Value expected is 0 or 1, the default is 0 when a value is not provided. When 1 is provided as the context, some property values such as Position, Normal, and StartPoint are promoted from a single value to individual X, Y, and Z values.
For example, the following displays the StartPoint first as not being promoted and then being as promoted:
  • Not promoted, context = 0StartPoint (type: AcGePoint3d)  (LocalName: StartPoint) = 6.250000   8.750000  0.000000
  • Promoted, context = 1StartPoint/X (type: double)  (LocalName: Start X) = 6.250000StartPoint/Y (type: double)  (LocalName: Start Y) = 8.750000StartPoint/Z (type: double)  (LocalName: Start Z) = 0.000000


Return Values
nil is returned by the function while the properties and their current values are output to the Command Window.
Examples
The following example demonstrates how to list the available properties for a line object with the properties Delta, EndPoint, Normal, and StartPoint promoted to individual values.
Command: (setq e1 (car (entsel "\nSelect a line: ")))Select a line:<Entity name: 10e2e4b20>Command: (dumpAllProperties e1 1)Begin dumping object (class: AcDbLine)Angle (type: double)  (RO)  (LocalName: Angle) = 5.159347Annotative (type: bool)  (LocalName: Annotative) = Failed to get value to get valueArea (type: double)  (RO)  (LocalName: Area) = 0.000000BlockId (type: AcDbObjectId)  (RO) = IxCastShadows (type: bool) = 0ClassName (type: AcString)  (RO) =Closed (type: bool)  (RO)  (LocalName: Closed) = Failed to get valueCollisionType (type: AcDb::CollisionType)  (RO) = 1Color (type: AcCmColor)  (LocalName: Color) = BYLAYERDelta/X (type: double)  (RO)  (LocalName: Delta X) = 3.028287Delta/Y (type: double)  (RO)  (LocalName: Delta Y) = -6.318026Delta/Z (type: double)  (RO)  (LocalName: Delta Z) = 0.000000EndParam (type: double)  (RO) = 7.006281EndPoint/X (type: double)  (LocalName: End X) = 23.249243EndPoint/Y (type: double)  (LocalName: End Y) = 11.968958EndPoint/Z (type: double)  (LocalName: End Z) = 0.000000ExtensionDictionary (type: AcDbObjectId)  (RO) = IxHandle (type: AcDbHandle)  (RO) = 1b2HasFields (type: bool)  (RO) = 0HasSaveVersionOverride (type: bool) = 0Hyperlinks (type: AcDbHyperlink*)IsA (type: AcRxClass*)  (RO) = AcDbLineIsAProxy (type: bool)  (RO) = 0IsCancelling (type: bool)  (RO) = 0IsEraseStatusToggled (type: bool)  (RO) = 0IsErased (type: bool)  (RO) = 0IsModified (type: bool)  (RO) = 0IsModifiedGraphics (type: bool)  (RO) = 0IsModifiedXData (type: bool)  (RO) = 0IsNewObject (type: bool)  (RO) = 0IsNotifyEnabled (type: bool)  (RO) = 0IsNotifying (type: bool)  (RO) = 0IsObjectIdsInFlux (type: bool)  (RO) = 0IsPeriodic (type: bool)  (RO) = 0IsPersistent (type: bool)  (RO) = 1IsPlanar (type: bool)  (RO) = 1IsReadEnabled (type: bool)  (RO) = 1IsReallyClosing (type: bool)  (RO) = 1IsTransactionResident (type: bool)  (RO) = 0IsUndoing (type: bool)  (RO) = 0IsWriteEnabled (type: bool)  (RO) = 0LayerId (type: AcDbObjectId)  (LocalName: Layer) = IxLength (type: double)  (RO)  (LocalName: Length) = 7.006281LineWeight (type: AcDb::LineWeight)  (LocalName: Lineweight) = -1LinetypeId (type: AcDbObjectId)  (LocalName: Linetype) = IxLinetypeScale (type: double)  (LocalName: Linetype scale) = 1.000000LocalizedName (type: AcString)  (RO) = LineMaterialId (type: AcDbObjectId)  (LocalName: Material) = IxMergeStyle (type: AcDb::DuplicateRecordCloning)  (RO) = 1Normal/X (type: double) = 0.000000Normal/Y (type: double) = 0.000000Normal/Z (type: double) = 1.000000ObjectId (type: AcDbObjectId)  (RO) = IxOwnerId (type: AcDbObjectId)  (RO) = IxPlotStyleName (type: AcString)  (LocalName: Plot style) = ByLayerReceiveShadows (type: bool) = 0 Failed to get valueStartParam (type: double)  (RO) = 0.000000StartPoint/X (type: double)  (LocalName: Start X) = 20.220956StartPoint/Y (type: double)  (LocalName: Start Y) = 18.286984StartPoint/Z (type: double)  (LocalName: Start Z) = 0.000000Thickness (type: double)  (LocalName: Thickness) = 0.000000Transparency (type: AcCmTransparency)  (LocalName: Transparency) = 0Visible (type: AcDb::Visibility) = 0End object dump


论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 1268个

财富等级: 财源广进

 楼主| 发表于 2013-8-7 21:57:20 | 显示全部楼层
setpropertyvalue (AutoLISP)





Sets the property value for an entity.
(setpropertyvalue   ename propertyname value [or collectionName index name val])
Arguments
ename
Name of the entity being modified. The ename can refer to either a graphical or a non-graphical entity.

propertynameName of the property to be modified. For a list of all the valid property names of a given object, use dumpallproperties.
valueValue to set the property to when the object is not a collection.
collectionNameIf the object is a collection object, the Collection name is passed here.
indexThe collection index to be modified.
nameName of the property in the collection to be modified.
valValue to set the property to.
Return Values
nil is returned unless an error occurs when the property value is being updated.
Examples
The following example demonstrates how to change the radius of a circle.
Command: (command "_circle" "2,2" 2)nilCommand: (setpropertyvalue (entlast) "radius" 3)
The following example demonstrates how to apply overrides to a linear dimension.
Command: (command "_dimlinear" "2,2" "5,4" "3,3")nilCommand: (setq e2 (entlast))<Entity name: 10e2e4bd0>Command: (setpropertyvalue e2 "Dimtfill" 2)nilCommand: (setpropertyvalue e2 "Dimtfillclr" "2")nilCommand: (setpropertyvalue e2 "Dimclrt" "255,0,0")nil
The following example demonstrates how to change the first vertex of the Vertices collection.
Command: (command "_pline" "0,0" "3,3" "5,2" "")nilCommand: (setq e3 (entlast))<Entity name: 10e2e4da0>Command: (setpropertyvalue e3 "Vertices" 0 "EndWidth" 1.0)nil


论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 6468个

财富等级: 富甲天下

发表于 2013-8-7 22:10:57 | 显示全部楼层
楼主能用中文表达一下吗?我等小学文化,看不懂吖。

点评

呵呵, 我也看不懂, 不过对括号内的能看懂就够了  详情 回复 发表于 2013-8-7 22:18
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 1268个

财富等级: 财源广进

 楼主| 发表于 2013-8-7 22:18:55 | 显示全部楼层
sicky111 发表于 2013-8-7 22:10
楼主能用中文表达一下吗?我等小学文化,看不懂吖。

呵呵, 我也看不懂,  不过对括号内的能看懂就够了
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 2个

财富等级: 恭喜发财

发表于 2013-8-7 22:41:14 | 显示全部楼层
看来CAD还有很多没公开的函数!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 604个

财富等级: 财运亨通

发表于 2013-8-7 22:41:37 | 显示全部楼层
本帖最后由 /db_自贡黄明儒_ 于 2013-8-7 22:43 编辑

是不是09开始增这3个命令的?

点评

2009 的 initcommandversion (AutoLISP) Forces the next command to run with the specified version. (initcommandversion [version]) This function makes it possible to force a speci  详情 回复 发表于 2013-8-7 22:44
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 1268个

财富等级: 财源广进

 楼主| 发表于 2013-8-7 22:44:32 | 显示全部楼层
本帖最后由 st788796 于 2013-8-7 22:48 编辑
/db_自贡黄明儒_ 发表于 2013-8-7 22:41
是不是09开始增这3个命令的?

2009 的
initcommandversion (AutoLISP)



Forces the next command to run with the specified version.
                (initcommandversion [version])
This function makes it possible to force a specific behavior for a supported command regardless of how it is being run.
This only affects commands that have been updated to support a command version. In such commands, a test for an
initialized command                  version replaces the legacy test for whether the command is being run from LISP or
a script. When a supported command is being run manually, the default version is 2 (or the latest version). When a
command is being run from automation, the default version is 1.               
Arguments               
version                          This argument specifies the version of the command to be used. If this argument is not
                                     present, the next use  (and next use  only) of a supported command will initialize to the
                                     latest version.                          

Return Values               
T               
Examples
Initializing a specific command version may affect each supported command differently. For example, here is the FILLET
command  with and without an initialized version:               


Command: FILLET
Current settings: Mode = TRIM, Radius = 0.0000
Select first object or [Undo/Polyline/Radius/Trim/Multiple]: *Cancel*

Command: (INITCOMMANDVERSION 1)

Command: FILLET
Current settings: Mode = TRIM, Radius = 0.0000
Select first object or [uNdo/Polyline/Radius/Trim/mUltiple]: *Cancel*
Another typical example is the COLOR command. Run normally, COLOR displays the Select Color dialog; but by running
(initcommandversion 1) before the COLOR command, it is forced to prompt from color from the command line.




论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 604个

财富等级: 财运亨通

发表于 2013-8-8 12:12:18 | 显示全部楼层
怎么回事,11版中(getpropertyvalue (car (entsel)) "radius")不能执行?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 1268个

财富等级: 财源广进

 楼主| 发表于 2013-8-8 12:14:22 来自手机 | 显示全部楼层
大小写敏感来自: Android客户端

点评

是不是你加载了另外的东西哟?  详情 回复 发表于 2013-8-8 16:10
怎么敏感,我是拷贝的帖子内容呢?  发表于 2013-8-8 12:36
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 604个

财富等级: 财运亨通

发表于 2013-8-8 16:10:53 | 显示全部楼层

是不是你加载了另外的东西哟?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-11-23 05:22 , Processed in 0.245178 second(s), 61 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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