找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 751|回复: 1

[发布] 像LWPOLYLINE一样操作2D/3D POLYLINE

[复制链接]

已领礼包: 40个

财富等级: 招财进宝

发表于 2018-6-12 16:47:20 | 显示全部楼层 |阅读模式

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

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

×
LWPOLYLINE有完备的方法解决各种问题,而2D/3D POLYLINE是复杂实体,由子顶点组成,操作起来很麻烦,现在API把三者结合到一起了,提供了下面的方法操作三种对象。

比如,求3DPOLYLINE的顶点数量

(xdrx_polyline_numverts ent)

删除3DPOLYLINE的顶点
(xdrx_polyline_removevertexat ent inx) or
(xdrx_polyline_removevertexat ent point)

1、xdrx_polyline_getpointat
2、xdrx_polyline_setpointat


3、xdrx_polyline_addvertexAt
4、xdrx_polyline_removeVertexAt

5、xdrx_polyline_getLineSegAt
6、xdrx_polyline_getArcSegAt

7、xdrx_polyline_getbulgeAt

8、xdrx_polyline_getWidthsAt
9、xdrx_polyline_hasBulges
10、xdrx_polyline_isOnlyLines
11、xdrx_polyline_numVerts
12、xdrx_polyline_OnSegAt
13、xdrx_polyline_NearIndex
14、xdrx_polyline_segType
15、xdrx_polyline_HasPlinegen
16、xdrx_polyline_getConstantWidth
17、xdrx_polyline_elevation

18、xdrx_polyline_compress
19、xdrx_polyline_setBulgeAt
20、xdrx_polyline_setEelevation
21、xdrx_polyline_setWidthsAt
22、xdrx_polyline_setThickNess
23、xdrx_polyline_setNormal
24、xdrx_polyline_setConstantWidth

以上红色的是LWPLYLINE,POLYLINE,3DPOLYLINE都适合的函数,其他是2DPOLYLINE和LWPOLYLINE适合的函数。

此外,xdrx_getpropertyvalue ,xdrx_setpropertyvalue全面支持,功能甚至更多

2DPOLYLINE

命令: (xdrx_getpropertyvalue (entlast))

Class AcDb2dPolyline:

    ├─Closed
    ├─Thickness
    ├─Vertices
    ├─FeaturePoints
    ├─Elevation
    ├─DefaultEndWidth
    ├─DefaultStartWidth
    ├─isLinetypeGenerationOn
    ├─Normal
    ├─PolyType

    ├─ArcSegAt
    ├─ArcSegIndex
    ├─LineSegIndex
    ├─BulgeAt
    ├─Bulges
    ├─Elevation
    ├─ConstantWidth
    ├─Get
    ├─LineSegAt
    ├─Lengths
    ├─HasBulges
    ├─HasPlinegen
    ├─HasWidth
    ├─InAngle
    ├─IsOnlyLines
    ├─Normal
    ├─NumVerts

    ├─OnSegAt(Point or (INT Point))    ├─PointAt
    ├─PrevNextIndex
    ├─SelfIntPoints
    ├─SelfIntParams
    ├─Thickness
    ├─Vertices
    ├─FeaturePoints
    ├─WidthsAt

Class AcDbCurve:

    ├─Area
    ├─EndParam
    ├─EndPoint
    ├─GetFirstDeriv
    ├─GetSecondDeriv
    ├─GetPointAtParam
    ├─GetPointAtDist
    ├─GetParamAtPoint
    ├─GetParamAtDist
    ├─GetDistAtPoint
    ├─GetDistAtParam
    ├─GetSamplePoints
    ├─IsClosed
    ├─IsPeriodic
    ├─MidPoint
    ├─StartPoint
    ├─StartParam
    ├─Length


Class AcDbEntity:

    ├─9PT
    ├─BoundingBox
    ├─Elevation
    ├─Color (None or T[real color])
    ├─ECS
    ├─IsMemoryEntity
    ├─Layer (None or T or NIL)
    ├─Layout
    ├─Linetype (None or T or NIL)
    ├─LinetypeScale
    ├─LineWeight
    ├─Plane
    ├─PlotStyleName
    ├─StretchPoint
    ├─Transparency
    ├─Visibility

Class AcDbObject:
    ├─ClassName
    ├─ExtensionDictionary
    ├─FieldDictionary
    ├─IsA
    ├─IsAProxy
    ├─IsErased
    ├─IsReallyClosing
    ├─Handle
    ├─HasFields
    ├─HasPersistentReactor
    ├─MyParent
    ├─ObjectID
    ├─Owner
    ├─xData


LWPOLYLINE:

命令: (XDRX_GETPROPERTYVALUE (CAR (ENTSEL)))

选择对象:
Class AcDbPolyline:

    ├─ArcSegAt
    ├─ArcSegIndex
    ├─LineSegIndex
    ├─BulgeAt
    ├─Bulges
    ├─Elevation
    ├─ConstantWidth
    ├─Get
    ├─LineSegAt
    ├─Lengths
    ├─HasBulges
    ├─HasPlinegen
    ├─HasWidth
    ├─InAngle
    ├─IsOnlyLines
    ├─Normal
    ├─NumVerts
    ├─OnSegAt
    ├─PointAt
    ├─PrevNextIndex
    ├─SelfIntPoints
    ├─SelfIntParams
    ├─Thickness
    ├─Vertices
    ├─FeaturePoints
    ├─WidthsAt

Class AcDbCurve:

    ├─Area
    ├─EndParam
    ├─EndPoint
    ├─GetFirstDeriv
    ├─GetSecondDeriv
    ├─GetPointAtParam
    ├─GetPointAtDist
    ├─GetParamAtPoint
    ├─GetParamAtDist
    ├─GetDistAtPoint
    ├─GetDistAtParam
    ├─GetSamplePoints
    ├─IsClosed
    ├─IsPeriodic
    ├─MidPoint
    ├─StartPoint
    ├─StartParam
    ├─Length


Class AcDbEntity:

    ├─9PT
    ├─BoundingBox
    ├─Elevation
    ├─Color (None or T[real color])
    ├─ECS
    ├─IsMemoryEntity
    ├─Layer (None or T or NIL)
    ├─Layout
    ├─Linetype (None or T or NIL)
    ├─LinetypeScale
    ├─LineWeight
    ├─Plane
    ├─PlotStyleName
    ├─StretchPoint
    ├─Transparency
    ├─Visibility

Class AcDbObject:
    ├─ClassName
    ├─ExtensionDictionary
    ├─FieldDictionary
    ├─IsA
    ├─IsAProxy
    ├─IsErased
    ├─IsReallyClosing
    ├─Handle
    ├─HasFields
    ├─HasPersistentReactor
    ├─MyParent
    ├─ObjectID
    ├─Owner
    ├─xData


3DPOLYLINE:

命令: (xdrx_getpropertyvalue (entlast))

Class AcDb3dPolyline:

    ├─PolyType
    ├─Vertices
    ├─NumVerts
    ├─OnSegAt (Point or (Int Point))
    ├─VertexAt(Int)
    ├─VertexType


Class AcDbCurve:

    ├─Area
    ├─EndParam
    ├─EndPoint
    ├─GetFirstDeriv
    ├─GetSecondDeriv
    ├─GetPointAtParam
    ├─GetPointAtDist
    ├─GetParamAtPoint
    ├─GetParamAtDist
    ├─GetDistAtPoint
    ├─GetDistAtParam
    ├─GetSamplePoints
    ├─IsClosed
    ├─IsPeriodic
    ├─MidPoint
    ├─StartPoint
    ├─StartParam
    ├─Length


Class AcDbEntity:

    ├─9PT
    ├─BoundingBox
    ├─Elevation
    ├─Color (None or T[real color])
    ├─ECS
    ├─IsMemoryEntity
    ├─Layer (None or T or NIL)
    ├─Layout
    ├─Linetype (None or T or NIL)
    ├─LinetypeScale
    ├─LineWeight
    ├─Plane
    ├─PlotStyleName
    ├─StretchPoint
    ├─Transparency
    ├─Visibility

Class AcDbObject:
    ├─ClassName
    ├─ExtensionDictionary
    ├─FieldDictionary
    ├─IsA
    ├─IsAProxy
    ├─IsErased
    ├─IsReallyClosing
    ├─Handle
    ├─HasFields
    ├─HasPersistentReactor
    ├─MyParent
    ├─ObjectID
    ├─Owner
    ├─xData


xdrx_setpropertyvalue

POLYLINE:

命令: (xdrx_setpropertyvalue (car (entsel)))

选择对象:
Class AcDb2dPolyline:

  ├─AppendVertex(Point or Point List)
  ├─Closed(T or NIL)
  ├─ConvertToPolyType(Int)
  ├─CurveFit(T)
  ├─DefaultEndWidth(Real or Int)
  ├─DefaultStartWidth(Real or Int)
  ├─Elevation(Real or Int)
  ├─LinetypeGenerationOff(T)
  ├─LinetypeGenerationOn(T)
  ├─Normal(3D VECTOR)
  ├─PolyType(Int 0-3)
  ├─SplineFit(T)
  ├─Straighten(T)
  ├─Thickness(Real)

Class AcDbPolyline:

  ├─AddVertexAt(Index Point)
  ├─RemoveVertexAt(Index or Point)
  ├─BulgeAt(Index Real)
  ├─Bulges(Double List)
  ├─CrossToUnicom (None)
  ├─ConstantWidth(Real or Int)
  ├─Elevation(Real or Int)
  ├─IsClosed(T or Nil)
  ├─Points(Point List)
  ├─PlineGen(T or Nil)
  ├─PointAt(Index Point)
  ├─Set((vert list)(bulge list))
  ├─SWAP(Point(INDEX1 INDEX2))
  ├─Thickness(Real or Int)
  ├─Radius(Double or (Index Double))
  ├─Reset(T or INT)
  ├─WidthsAt(Index StartWidth EndWidth)
  ├─Widths( (swid1 ewid1)...(swidn ewidn) )
  ├─Normal(Point)
  ├─Vertices(Point List)

Class AcDbEntity:

  ├─Color(Int)
  ├─Elevation(Int or Real)
  ├─Layer(STR)
  ├─Linetype(STR)
  ├─LinetypeScale(Real or Int)
  ├─LineWeight(INT)
  ├─PlotStyleName(STR)
  ├─Project(Plane Normal T)
  ├─Transparency(0-100)
  ├─Visibility(T or Nil)
  ├─Z->0(None Or T)


Class AcDbObject:

  ├─RemovePersistentReactor (ENAME)
  ├─releaseExtensionDictionary (None)
  ├─SetXdata (STR val1...valn)
  ├─xDataTransformBy (matrix)


LWPOLYLINE:

命令: (xdrx_setpropertyvalue (car (entsel)))

选择对象:
Class AcDbPolyline:

  ├─AddVertexAt(Index Point)
  ├─RemoveVertexAt(Index or Point)
  ├─BulgeAt(Index Real)
  ├─Bulges(Double List)
  ├─CrossToUnicom (None)
  ├─ConstantWidth(Real or Int)
  ├─Elevation(Real or Int)
  ├─IsClosed(T or Nil)
  ├─Points(Point List)
  ├─PlineGen(T or Nil)
  ├─PointAt(Index Point)
  ├─Set((vert list)(bulge list))
  ├─SWAP(Point(INDEX1 INDEX2))
  ├─Thickness(Real or Int)
  ├─Radius(Double or (Index Double))
  ├─Reset(T or INT)
  ├─WidthsAt(Index StartWidth EndWidth)
  ├─Widths( (swid1 ewid1)...(swidn ewidn) )
  ├─Normal(Point)
  ├─Vertices(Point List)

Class AcDbEntity:

  ├─Color(Int)
  ├─Elevation(Int or Real)
  ├─Layer(STR)
  ├─Linetype(STR)
  ├─LinetypeScale(Real or Int)
  ├─LineWeight(INT)
  ├─PlotStyleName(STR)
  ├─Project(Plane Normal T)
  ├─Transparency(0-100)
  ├─Visibility(T or Nil)
  ├─Z->0(None Or T)


Class AcDbObject:

  ├─RemovePersistentReactor (ENAME)
  ├─releaseExtensionDictionary (None)
  ├─SetXdata (STR val1...valn)
  ├─xDataTransformBy (matrix)


3DPOLYLINE:

命令: (xdrx_getpropertyvalue (entlast))

Class AcDb3dPolyline:

    ├─PolyType
    ├─Vertices
    ├─NumVerts
    ├─OnSegAt (Point or (Int Point))
    ├─VertexAt(Int)
    ├─VertexType


Class AcDbCurve:

    ├─Area
    ├─EndParam
    ├─EndPoint
    ├─GetFirstDeriv
    ├─GetSecondDeriv
    ├─GetPointAtParam
    ├─GetPointAtDist
    ├─GetParamAtPoint
    ├─GetParamAtDist
    ├─GetDistAtPoint
    ├─GetDistAtParam
    ├─GetSamplePoints
    ├─IsClosed
    ├─IsPeriodic
    ├─MidPoint
    ├─StartPoint
    ├─StartParam
    ├─Length


Class AcDbEntity:

    ├─9PT
    ├─BoundingBox
    ├─Elevation
    ├─Color (None or T[real color])
    ├─ECS
    ├─IsMemoryEntity
    ├─Layer (None or T or NIL)
    ├─Layout
    ├─Linetype (None or T or NIL)
    ├─LinetypeScale
    ├─LineWeight
    ├─Plane
    ├─PlotStyleName
    ├─StretchPoint
    ├─Transparency
    ├─Visibility

Class AcDbObject:
    ├─ClassName
    ├─ExtensionDictionary
    ├─FieldDictionary
    ├─IsA
    ├─IsAProxy
    ├─IsErased
    ├─IsReallyClosing
    ├─Handle
    ├─HasFields
    ├─HasPersistentReactor
    ├─MyParent
    ├─ObjectID
    ├─Owner
    ├─xData


命令: (xdrx_setpropertyvalue (car (entsel)))

选择对象:
Class AcDb2dPolyline:

  ├─AppendVertex(Point or Point List)
  ├─Closed(T or NIL)
  ├─ConvertToPolyType(Int)
  ├─CurveFit(T)
  ├─DefaultEndWidth(Real or Int)
  ├─DefaultStartWidth(Real or Int)
  ├─Elevation(Real or Int)
  ├─LinetypeGenerationOff(T)
  ├─LinetypeGenerationOn(T)
  ├─Normal(3D VECTOR)
  ├─PolyType(Int 0-3)
  ├─SplineFit(T)
  ├─Straighten(T)
  ├─Thickness(Real)

Class AcDbPolyline:

  ├─AddVertexAt(Index Point)
  ├─RemoveVertexAt(Index or Point)
  ├─BulgeAt(Index Real)
  ├─Bulges(Double List)
  ├─CrossToUnicom (None)
  ├─ConstantWidth(Real or Int)
  ├─Elevation(Real or Int)
  ├─IsClosed(T or Nil)
  ├─Points(Point List)
  ├─PlineGen(T or Nil)
  ├─PointAt(Index Point)
  ├─Set((vert list)(bulge list))
  ├─SWAP(Point(INDEX1 INDEX2))
  ├─Thickness(Real or Int)
  ├─Radius(Double or (Index Double))
  ├─Reset(T or INT)
  ├─WidthsAt(Index StartWidth EndWidth)
  ├─Widths( (swid1 ewid1)...(swidn ewidn) )
  ├─Normal(Point)
  ├─Vertices(Point List)

Class AcDbEntity:

  ├─Color(Int)
  ├─Elevation(Int or Real)
  ├─Layer(STR)
  ├─Linetype(STR)
  ├─LinetypeScale(Real or Int)
  ├─LineWeight(INT)
  ├─PlotStyleName(STR)
  ├─Project(Plane Normal T)
  ├─Transparency(0-100)
  ├─Visibility(T or Nil)
  ├─Z->0(None Or T)


Class AcDbObject:

  ├─RemovePersistentReactor (ENAME)
  ├─releaseExtensionDictionary (None)
  ├─SetXdata (STR val1...valn)
  ├─xDataTransformBy (matrix)


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

已领礼包: 47个

财富等级: 招财进宝

发表于 2019-12-29 09:55:24 | 显示全部楼层
晓东专用支持函数,在外边用很麻烦,不装支持函数补丁就没法用插件
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-15 02:34 , Processed in 0.161380 second(s), 30 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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