Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Polyline base code object

sinceV6
Participant
Hello everyone.

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 really need because I've just been adding stuff and parameters to the GS parking place object for years.

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.

http://archicad-talk.graphisoft.com/viewtopic.php?p=164099&highlight=polyline#164099
http://archicad-talk.graphisoft.com/viewtopic.php?p=167325&highlight=dynamic+array#167325
http://archicad-talk.graphisoft.com/viewtopic.php?p=163424&highlight=dynamic+array#163424
http://archicad-talk.graphisoft.com/viewtopic.php?p=117388&sid=84c8152f200b0e00fce3c5ca31cce51e
http://archicad-talk.graphisoft.com/viewtopic.php?t=30992&postdays=0&postorder=asc&&start=30&sid=5b2...

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.
37 REPLIES 37

mariosmic
Participant
Here 2d view
Mac Pro 3 GHZ 16 GB - OS X 10.12 - Archicad 20
www.studioarcrea.com
www.facebook.com/3DMD.3DMediaDesign

boatingcow
Beginner
Olivier, Mario, this tool is excellent. I think it should be a native feature of ArchiCAD! I have been looking for a tool like this for a while (see this post: http://archicad-talk.graphisoft.com/viewtopic.php?t=45472) but my GDL isn't so good!

Do you think it would be difficult to report the length of each segment and also the total length in the schedules? Also, do you think it would be difficult to show a cross-section area, or report a total volume? Thanks
ArchiCAD 17 | InterPro | Intel i7-4790K | 32GB RAM | Nvidia Quadro K2200 4GB | Windows 10 Pro

mariosmic
Participant
boatingcow wrote:
Olivier, Mario, this tool is excellent. I think it should be a native feature of ArchiCAD! I have been looking for a tool like this for a while (see this post: http://archicad-talk.graphisoft.com/viewtopic.php?t=45472) but my GDL isn't so good!

Do you think it would be difficult to report the length of each segment and also the total length in the schedules? Also, do you think it would be difficult to show a cross-section area, or report a total volume? Thanks
No it's not difficult. The master object already compute lenght of each segment and total. I need only add a variable in the parameters. Also the volume, if I set a section, as in the other my object based on the same master.
Mac Pro 3 GHZ 16 GB - OS X 10.12 - Archicad 20
www.studioarcrea.com
www.facebook.com/3DMD.3DMediaDesign

Anonymous
Not applicable
Great job!
Could be a good starting point for some interesting objects.
Thanks for sharing!

Anonymous
Not applicable
Olivier wrote:
*SNIP*
Wow, Olivier, this object is amazing! I have been searching for a fuature like this forever! So handy for drawing eave lines, floor lines etc. that you want to be visible across multiple floors.

I can only think of one way to improve this. Right now the floor plan display options for this object is a little limited with the options "show on relevant stories", "all stories", or "home story +above/below" etc.

Would it be possible to change the object code so the floor plan display options act like they do for slabs and roofs? I.e with a custom setting, where you can select on how many floors up and down you want the object to be visible?

Thanks for this!

Such options are possible(in any object), however the UI must be different as all settings must be done "in object". Something similar is in elevator object in the default library.

Piotr

Lingwisyer
Virtuoso
This should totally be pinned in this sub-forum.
AC18-23 AUS 7000
Self-taught, bend it till it breaks.
Win10 | E5620 x 2 | 24GB | K2200

Agreed. And or even a thread where we can post the objects we make, or leave links so its easy to find the work that has generated from this code.
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

Hmooslechner
Expert
i updatet my old object with the "new Profile" - Commands:

german, turn off the sound, just watch..


Bimcomponents:
https://bimcomponents.com/GSM/Details/23833
AC5.5-AC25EduAut, PC-Win10, MacbookAirM1

Barry Kelly
Moderator
Hmooslechner wrote:
i updatet my old object with the "new Profile" - Commands:

Looks great but I can't download (drag & drop) from BimComponents to 23.


Any body else able to do it?
Website counts it as being downloaded even though it isn't.

Also I can only access it via your link.
Searching for it in BIMComponents or in the object settings shows nothing.


Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

The same here..

Piotr

Nuge
Enthusiast
and here
AC25 i9 11900K / 128G ram / GTX 3090 / Enscape

Hmooslechner
Expert
Try my dropboxfile?

https://www.dropbox.com/s/5u1z9iu4jwd9j0z/Archicad23%20GDL%20Freies%20Polygon%20mit%20Profil.pln?dl=...

AC23EduAut
AC5.5-AC25EduAut, PC-Win10, MacbookAirM1

Barry Kelly
Moderator
Hmooslechner wrote:
Try my dropboxfile?

Thank you.

Barry.

One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

Nader Belal
Advisor
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), but I'm having trouble as you can see in the following animation (click on image to activate gif)


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 (which by the way have the same index number of the unmodified polygon) gets to move, as if there is a hidden cursor that is moving it to, which at the end leads that the intended vertex doesn't gets to add up.

So using pseudocode, what do you expect that I have done wrong in my script ??
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Post your object so we can look and not have to guess
AC 24, Twinmotion current, Windows 11, Msi 10UG with rtx 3070, wacom intuos pro m, Wacom Cintiq Pro 16, razer Tartarus pro.

sinceV6
Participant
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.

Nader Belal
Advisor
Hi everyone,

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 as I could tell, but take it with a pinch of salt) ....

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.
A good friend of mine have once told me that I´m so brute that I´m capable of creating a GDL script capable of creating GDLs.

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!