• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Visual LISP, AutoLISP and General Customization

    Reply
    *Expert Elite*
    Kent1Cooper
    Posts: 4,167
    Registered: ‎09-13-2004

    Re: Line from origin to object centers

    01-04-2013 12:52 PM in reply to: greenj1

    greenj1 wrote:

    Kent once again thankyou, this works perfectly on the circles I have tested it on.

    However my circles have to be converted into 3D polylines. The lisp does not seem to work on them !

    I assumed they would have an inserition point or centre and it would work the same way.

    Any suggestions ?


    No, they don't have a defined center or insertion point, just a string of vertices, and AutoCAD doesn't have any way to know directly whether they all fall on a common circular path.  But if they're geometrically regular, a center can be calculated.  This:

    http://cadtips.cadalyst.com/2d-editing/convert-regular-polygons-circles

    contains a method to do that.  Appropriate parts could be transferred, but it would make the code a lot longer.

     

    On the other hand, if the conversion to 3DPolylines is done by something that always does it in the same way, e.g. it always makes a regular polygon with the same number of vertices [or even just always an even number of vertices] in each conversion, then we can assume some of what that routine tests for, and a much simpler way could be devised to calculate their centers.  Are they regular in some predictable way?

    Kent Cooper
    Please use plain text.
    Active Member
    Posts: 6
    Registered: ‎01-03-2013

    Re: Line from origin to object centers

    01-05-2013 06:33 AM in reply to: Kent1Cooper

    They dont seem to have any common propoerties. They start as circles then I import them into 3ds max and use bend and spherify modifers to turn the 2d layout into a spherical arrangement, then back into CAD where they become 3D polylines.

     

    I guess I need to find an object which will retain a centre point or insertion point whne transfered between the two program. perhapes a point/node. Il see what I can find. Any suggestions welcome. Thanks for your help so far.

    Please use plain text.
    Active Member
    Posts: 6
    Registered: ‎01-03-2013

    Re: Line from origin to object centers

    01-05-2013 12:09 PM in reply to: greenj1

    I found a MAXscript which placed point at the center of each spline (3d polylines in CAD) and bingo your lisp worked perfectly. Many thanks ! :smileyhappy:

    Please use plain text.