Dynamic Polyline base code object
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2013-09-21
03:36 AM
- last edited on
2024-09-26
01:46 PM
by
Doreena Deng
In the past couple of months I've been in a GDL streak creating, updating and fixing lots of little self made parts... and the code just seemed to flow; so I tackled my wish to have (make, to learn, in my case) a dynamic polyline. A few months ago, I sketched a new "parking place" object that I wanted, but just didn't have the time to do; and didn't
I did some research a few years ago, but just kept the links for reference. Now that I was naturally digging into GDL again, I though I could make it possible.
The basic code for a Dynamic Polyline is useful for me; and I thought many people here could benefit from it. I tried several approaches for two weeks trying to make it work the way I wanted (I'm really no expert in GDL). It solves a few issues and serves as learning resource too, as it dynamically adds points to the polyline between segments, adds points at the end, dynamically removes points and dynamically grows and shrinks arrays.
I already have other ideas for this, like a 3D railing (the code already has Z for each point). I'm not putting it in BIMcomponents (this is for AC15+) or the Depository as it is not a final product.
I hope you find it useful, if you do, leave a comment; the only condition is that if you use it for something, you must post back the developed object with the code unlocked so other people can see how to implement it in new objects. (so please, no locked commercial derivatives... this is for the community)
Thanks to the plethora of information found in this community.
Enjoy.
The "Dynamic Polyline ER" base code object:
EDIT: new version: added a few things, like length of the segments, and a visual constraint for the first segment to keep at least 2 points.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-04-15 10:07 AM
Piotr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-04-15 10:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-04-15 03:29 PM
AC23EduAut

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-04-16 02:41 AM
Hmooslechner wrote:
Try my dropboxfile?
Thank you.
Barry.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-05-25 10:00 PM
I have been trying to write my own script based on the procedures that you all have provided in here (
So the idea is to create a close polygonal solid with a minimum of 3 vertices ... and as you can see, I have been successful of making the user able to delete any polygonal vertices in real time, but, when ever the user tries to move a mid-point hotspot to add an extra vertex to the polygon, in real time it's been added up, but the new midpoint hotspot (
So using pseudocode, what do you expect that I have done wrong in my script ??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-05-31 05:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-06-01 04:54 PM
Moonlight wrote:
Hi every one,
I have been trying to write my own script based on the procedures that you all have provided in here (to which I'm thankful), ......
So using pseudocode, what do you expect that I have done wrong in my script ??
Hi!
The most probable thing is that you missed updating some array with new points/coordinates. Happened to me too. Without knowing how you've scripted this, it would be hard to guess where is the problem.
Let me dig around my old stuff. I have a few stripped down second versions of this that you could use to build upon for your needs.
Best regards.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2020-07-08 08:25 PM
I think that I have pin pointed where did my script gone wrong, which is still giving me the headaches.
It's in the Graphical editing Hotspots (
As much I could observe, as long as I use the Midpoints Hotspots, it appears to create a feedback loop, between the old form and new form of the polygone.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2022-11-02 11:20 AM
thank you Mario for sharing. very useful!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2023-10-06 11:33 AM
Thanks for your contribution, since6V! Here's my minimal, stripped down version of a dynamic polygon for AC26. I've used it for a customer project that wasn't publicly available, so to keep in line with the spirit of this thread, I'll make it available here. It doesn't contain anything novel, but maybe it could be useful as a clean starting template. If memory serves, I think I adapted it from the original polyline code without noticing that there was a polygon version too. I copied the area calculation code from the polygon version. No guarantee of correct operation...