Author Topic: lisp for topology  (Read 1971 times)

0 Members and 1 Guest are viewing this topic.

codrutbenedic81

  • Mosquito
  • Posts: 6
lisp for topology
« on: March 02, 2023, 06:42:17 AM »
Hello!

Have you a lisp for making topology in AutoCAD?

Thank you!

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8586
  • AKA Daniel
Re: lisp for topology
« Reply #1 on: March 02, 2023, 07:25:53 AM »
this has a Delaunay routine exposed to lisp, see reply 10

https://www.theswamp.org/index.php?topic=58049.0

I'm sure there's other goodies if you search around

VovKa

  • Water Moccasin
  • Posts: 1617
  • Ukraine
Re: lisp for topology
« Reply #2 on: March 02, 2023, 07:56:15 AM »
Hello!

Have you a lisp for making topology in AutoCAD?

Thank you!
i'm afraid you will have to switch to Map 3d to work with topologies

xdcad

  • Bull Frog
  • Posts: 424
Re: lisp for topology
« Reply #3 on: November 21, 2023, 01:08:18 PM »
Create an MPOLYGON object in AUTOCAD and use it for topological analysis


« Last Edit: November 21, 2023, 01:12:35 PM by xdcad »
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
[XDrx-Sub Forum]
https://www.theswamp.org/index.php?board=78.0
https://github.com/xdcad/XDrx-API
http://bbs.xdcad.net

domenicomaria

  • Swamp Rat
  • Posts: 720
Re: lisp for topology
« Reply #4 on: November 22, 2023, 07:36:00 AM »
Is MPOLYGON a CUSTOM ENTITY ?

have you also thought about "exporting" from ARX environment
functions to create custom entities ?

(in addition to MPOLYGON)

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8586
  • AKA Daniel
Re: lisp for topology
« Reply #5 on: November 22, 2023, 07:42:21 AM »
Is MPOLYGON a CUSTOM ENTITY ?

have you also thought about "exporting" from ARX environment
functions to create custom entities ?

(in addition to MPOLYGON)

its in autocad, but sometimes the dbx has to be loaded separately
the class is AcDbMPolygon

arx docs
Quote
Handles one or more closed polygons as a unit. Contains an AcDbHatch member for rendering and other tasks, via AcDbMpolygon::hatch( ).

domenicomaria

  • Swamp Rat
  • Posts: 720
Re: lisp for topology
« Reply #6 on: November 22, 2023, 07:56:30 AM »
therefore it is a native Autocad entity...

I didn't know it existed!

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8586
  • AKA Daniel
Re: lisp for topology
« Reply #7 on: November 22, 2023, 08:16:54 AM »
It has a method isPointInsideMPolygon thatís useful for finding of a point is in a polyline, otherwise I think itís not used often
example https://www.theswamp.org/index.php?topic=58308.msg616936#msg616936

xdcad

  • Bull Frog
  • Posts: 424
Re: lisp for topology
« Reply #8 on: November 22, 2023, 09:56:17 AM »
Is MPOLYGON a CUSTOM ENTITY ?

have you also thought about "exporting" from ARX environment
functions to create custom entities ?

(in addition to MPOLYGON)

Not a custom entity
The underlying core supports it,
It's just that AUTUCAD didn't make it for end users.
ARX supports creating it

Through XDRX-API, LISP can operate it

Query method:

Command: (xdrx-mpolygon-make (entlast))
<Entity name: 2378c48c0a0>
Command: (xdrx-getpropertyvalue (entlast))
Class AcDbMPolygon:
    ├─Area (None or Int)
    ├─Detach
    ├─DetachLoopAt (Point or Int)
    ├─Elevation
    ├─ExtractLoopAt (Point or Int)
    ├─IsBalanced
    ├─OffsetVector
    ├─PatternDefinitionAt
    ├─Perimeter
    ├─Length
    ├─Normal
    ├─NumPatternDefinitions
    ├─IncludesTouchingLoops
    ├─IsPointInsideMPolygon
    ├─IsPointOnLoopBoundary
    ├─SelfCrosses
    ├─PatternAngle
    ├─patternColor
    ├─PatternScale
    ├─PatternDouble
    ├─PatternSpace
    ├─PatternName
    ├─PatternType
    ├─Perimeter
Loops Class:
    ├─ChildLoops(ParentLoop Inx [T])
    ├─ClosestLoopTo / LoopIndexTo (Int or Point)
    ├─HasChildLoop([T])
    ├─GetLoopAt / LoopAT(Int or Point)
    ├─GetLoops/ALLLoops (None or T)
    ├─GetLoopsAt(Int .... Int)
    ├─LoopAtGsMarker
    ├─LoopDirection
    ├─MPolygonLoopAt (Int or Point)
    ├─MPolygonLoops (None or T)
    ├─NumLoops
    ├─OverLapLoops([T])
    ├─ParentLoop
    ├─RootLoop / RootLoopAt(Int or Point)
    ├─RootLoopIndexAt / RootLoopIndex(Int or Point)
    ├─RootLoops
Class AcDbEntity:
    ├─9PT
    ├─BoundingBox
    ├─Color (None or T[real color])
    ├─ColorIndex(None or T)
    ├─Centroid
    ├─ECS
    ├─Elevation
    ├─Ename
    ├─GeomExtents
    ├─ GripPoints
    ├─IsMemoryEntity
    ├─Layer(None or T or NIL)
    ├─Layout
    ├─Linetype(None or T or NIL)
    ├─LinetypeScale
    ├─LineWeight
    ├─OrthoProject(Plane  T)
    ├─Project(Plane Normal T)
    ├─PersistentReactor
    ├─Plane
    ├─PlotStyleName
    ├─StretchPoint
    ├─Transparency
    ├─Visibility
    ├─XDir
Class AcDbObject:
    ├─ClassName
    ├─OriginalDatabase
    ├─Database
    ├─ExtensionDictionary
    ├─FieldDictionary
    ├─IsA
    ├─IsAProxy
    ├─IsErased
    ├─IsReallyClosing
    ├─Handle
    ├─HasFields
    ├─HasPersistentReactor
    ├─MyParent
    ├─ObjectID
    ├─Owner
    ├─xData

Editing method:

Command: (xdrx-setpropertyvalue (entlast))
Class AcDbMPolygon:
  ├─BalanceTree (None)
  ├─BalanceDisplay (None)
  ├─Elevation (Double)
  ├─Gradient (Int STR)
  ├─GradientAngle (Double)
  ├─GradientShift (Int)
  ├─Normal (Vector)
  ├─LoopDirection (Int Int)
  ├─Pattern (Int Str)
  ├─PatternAngle (double)
  ├─PatternColor (POINT or Int)
  ├─PatternDouble (T or NIL)
  ├─PatternScale (Double or Int)
  ├─PatternSpace (Double or Int)
  ├─AppendLoop ((Ename or GeEnt or DBEnt or (Points and Doubles) or T))
  ├─AppendMPolygonLoop (Points and Doubles or T)
  ├─AppendLoopFromBoundary (Enames [T])
  ├─InsertMPolygonLoopAt (INT Enames Doubles [T])
  ├─RemoveHatch (None)
  ├─removeMPolygonLoopAt (Int)
  ├─evaluateHatch (None or T)
Class AcDbEntity:
  ├─Color(Int)
  ├─Elevation(Int or Real)
  ├─Layer(STR)
  ├─Linetype(STR)
  ├─LinetypeScale(Real or Int)
  ├─LineWeight(INT)
  ├─PlotStyleName(STR)
  ├─OrthoProject(Plane T)
  ├─Project(Plane Normal T)
  ├─TransformBy
  ├─Transparency(0-100)
  ├─Visibility(T or Nil)
  ├─Z->0(None Or T)
Class AcDbObject:
  ├─CopyFrom (Ename)
  ├─RemovePersistentReactor (ENAME)
  ├─CreateExtensionDictionary (None)
  ├─releaseExtensionDictionary (None)
  ├─SetXdata (STR val1...valn)
  ├─xDataTransformBy (matrix)
« Last Edit: November 22, 2023, 10:00:41 AM by xdcad »
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
[XDrx-Sub Forum]
https://www.theswamp.org/index.php?board=78.0
https://github.com/xdcad/XDrx-API
http://bbs.xdcad.net

gile

  • Water Moccasin
  • Posts: 2495
  • Marseille, France
Re: lisp for topology
« Reply #9 on: November 22, 2023, 10:39:04 AM »
Hi,

We can create MPolygons with AutoLISP entmake function, see this example.
Speaking English as a French Frog