Author Topic: Enhanced Polyline Tutorial - Part 1  (Read 2736 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
Enhanced Polyline Tutorial - Part 1
« on: April 10, 2009, 04:30:44 AM »
Arg, I wrote this over the last couple hours and poof lost it by a simple back buttom on the web.  Hmmm, mmmmm,
calmmmmm, begin again....

It appears that there is some interest in custom object ARX objects, so I figure Id try and put together a tutorial.
I dont know how well this forum is suited to tutorials so Ill break it up in to a few parts, keeping the prefix of the
subject line, changing the part number and possibility adding a suffix to help describe the tut.  Please, for taking on
this project, feel free to shoot me know  :ugly:.

    Items I hope to cover in the tut:
    • 12 step recovery to having a life outside of computers...Oops, wrong forum HP is a door knob...
    • Creating a custom entity (derived from AcDbPolyline)
    • Persistent data for the custom entity
    • Lipstick and a pig, adding a UI to the application

    Unless you've had the opportunity to implement custom entities in the past, you'll find that custom DBX entities can be kind of hard.
    The first few go around you'll be looking for sample code from the UofGoogle.  Most of what you find is bunk!!! (not
    saying what I present here is bunk as well, but my bunk as a certain smell too it, and I just don't smell my bunk!  :roll:)

    Here is a simple request as it arrived in my inbox from the flight engineers I support (over simplified):  Every time we have to
    make a change to the flight path we also have to change the containment (for you civil types read this as, "every time we
    move the center line we have to redraw the sidewalks, gutters, etc.).  Ok, first, no matter how good your are (or think you are)
    always, answer any request coming your way as "I'll think about it".  I know, your God's gift to programming and your ARX don't
    stink.  Still, tell the user you'll think about it (then go home for the next 5 days thrashing code to earn your "God" title...then enroll
    yourself in a self help group modeled after AA).

    Ok, user has made the request, you've written up a requirements doc.  The doc has gone the 6 modifications (thank goodness, because
    there are black holes the user never talked about during the initial meeting), and you've come up with the following simple requests...
    1) Users should be able to draw a flight path (center line) and define simple (for the the tut) containment).
    2) User should be able to drag flight path and containments update automatically.
    3) User should be able define unique containment for each flight path.

    Pretty simple requirements right.  Ok, sounds like a custom entity is required.  What kind...AcDbPolyline should do the trick.
    Hmm.  How to store and retrieve any custom data (offset and layer prefixes (not outlined above).
    How about different linetype styles?? (can't do everything for you, will be left for you to figure out).

    The tut's will be precented as is.. Hopefully, others will step up and correct errors or offer easier solutions.  This is a learning tut,
    and as such I'll be learning from you as well.  My skin is thick, bash my code all you want, but please, please be respectful of others
    that may just be learning.  This is about sharing code, not about sharing how big your balls are.



  • Bull Frog
  • Posts: 344
Re: Enhanced Polyline Tutorial - Part 1
« Reply #1 on: April 10, 2009, 06:28:18 AM »
Ill be lurking (wont be able to contribute due to an almost complete lack of ARX skills).   The thread promises to be quite entertaining.  :-)
Sean Tessier
AutoCAD 2016 Mechanical


  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Enhanced Polyline Tutorial - Part 1
« Reply #2 on: April 10, 2009, 06:59:03 AM »
Simply outstanding contribution Paul, looking forward to this with great interest. Pre thanks and kudos.
Engineering Technologist CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7096
  • AKA Daniel
Re: Enhanced Polyline Tutorial - Part 1
« Reply #3 on: April 10, 2009, 07:25:04 AM »
Awesome! I can use this  8-)

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9717
Re: Enhanced Polyline Tutorial - Part 1
« Reply #4 on: April 10, 2009, 08:15:15 AM »
I like it!

BTW, you can have a forum of your own; just shoot Mark Thomas a PM stating that you want a child forum in the TeachMe board. You can even have moderator rights there where you can prune and split threads as you see fit. (serving the CAD community since 2003)

Donate to


  • Guest
Re: Enhanced Polyline Tutorial - Part 1
« Reply #5 on: April 10, 2009, 10:17:04 AM »
I'm looking forward to this as well.

Thanks for putting forth the effort.



  • Guest
Re: Enhanced Polyline Tutorial - Part 1
« Reply #6 on: April 10, 2009, 11:48:12 AM »
Sorry bout the spelling and grammer errors in da post, lets just say I need two asprin right now
and could crawl back to bed.   ;-)