GDL
About building parametric objects with GDL.

Custom Scripted 2D Hotspot Editors

scottjm
Expert

I have seen objects in the past where people have scripted additional custom hotspots editors into their object so you can active 'edit mode' in the object for example and there are hotspots / hotlines that spell out words etc in 2D.

 

See below screenshot of the type of thing from a CADSwift object:

scottjm_0-1701933529650.png

 

I went hunting but I couldn't find anything definitive on how to make them.  hotline2 is only an invisible snap it seems.

 

Anyone got any ideas or made one?

 

Thanks,

 

 

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe
8 REPLIES 8
DGSketcher
Legend

Interesting idea to have edit mode. I have an MVO switch to display a list of key parameters, I guess edit mode would need something similar. 

 

I would imagine in simple terms it is a case of establishing a base point and then coordination of graphics and a controlled stretchy hotspot distance. Previously I have simply dragged / rotated a hotspot to set a parameter and the 2D image updates. Coordinating that with option lists is a clever idea, but it may be frustrating if the graphics clash with the rest of the drawing. I would be really impressed if the option list only appeared for a single hotspot when it was moved, I have a feeling that should be possible if you can manage the options with last moved hotspot (glob_modpar_name?)

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
danielk
Booster

Hi,

 

Wow, cool stuff. Haven't seen this one before, but no surprise, CADswift does pretty good stuff. 😄

 

Hotlines, Hotarcs, etc. are just invisible lines for snapping/dimensioning, you won't be able to make anything interactive with them. The only way for graphical editing in objects is by using hotspots.

 

By themselves, hotspots also don't do much, just give you points you can snap to or dimension. These standard hotspots appear as black dots. But you can make them interactive, so you can perform stretching/rotating operations. These hotspots are the purple/pink rhombus shaped spots. These work in a way that when you grab that spot, and start pulling on it, you are actually changing the value of a number. It is just like entering it manually, except graphically.

 

Now, in this case I am assuming that this kind of rotating/stretching feature is "being abused" to make this work. Most likely, when you pull on that hotspot, you are going to be editing a number, and the code behind it is written in a way, that if the number is at 90° the code will perform some command, and if it is at 180° it will perform a different command (or something of that nature).

You can find out more about how to make editable hotspots here: https://gdl.graphisoft.com/gdl-basics/hotspots-graphical-editing

You can also find out more about how to tell if the value was just changed using the GLOB_MODPAR_NAME global in the same article (so it would only perform the command when you change it, and not constantly while the value is 90°).

You can also use the VALUES command to limit the available steps (e.g. so you would only be able to set 0, 90, 180, 270 degrees, and no other options): https://gdl.graphisoft.com/gdl-basics/parameter-logic

 

That is my 2 cents.

Lingwisyer
Guru

When you say "Edit Mode", what is the visibility toggle? MVO, parameter toggle, selection?

Maybe Kristian will reveal his secrets =P

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
Barry Kelly
Moderator

As Daniel wrote, it is the position of a hotspot that sets a certain value.

That value then gets interpreted as a particular command.

The images and lines you see behind the hotspots are just that - images and lines.

 

For example I have a gutter/fascia object that is a stretchy polyline object.

To the side I have added a hotspot that can have two positions +75mm & -75mm.

These then set a boolean parameter to 1 (on) & 0 (off), or in my case a text parameter "On" & "Off".

 

Turning that parameter "On", or moving the hotspot in plan, then activate a whole bunch of more hotspots that are also on/off or a grid of positions where each position sets a parameter that chooses a different gutter or fascia profile.

So basically it is just hotspots with set positions, that in turn set the value for other parameters.

 

BarryKelly_2-1702001921368.png

 

Just to be 'cute' I added a picture of a light switch to the on/off hotspots.

 

BarryKelly_1-1702001774208.png

 

Unfortunately I can't share the actual object, but if I get some time on the weekend I will try to strip out some of the hotspot scripting and post it here.

This was done as more of a proof of concept rather than something truly useful.

I actually just use the graphical user interface more often than this.

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Yeah, I have done similar things, but only for debugging purposes or as an auto dimension. The issue here is how do you make it so that you do not accidentally show it on the actual drawings?

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
scottjm
Expert

Thanks for all your feedback guys.  I have used rotating and sliding hotspots before as toggles and they work pretty well.

I was more interested in how you could add text and feedback to those kinds of toggles that is only visible in the 2D view when you are editing a hotspot and does not print.  Maybe I am mis-remembering and it was just 2D linework or images that were visible when an 'Edit Mode; parameter in the object  was turned on.

 

@Barry Kelly - that looks hardcore.  Confirming that when those are visible in the 2D view, they would also print on the drawing?

 

What I am specifically attempting to achieve in this instance is with a ceiling services object, being able to move it's 2D ceiling plan symbol and the 3D geometry separately, but still be able to see the position of the outline of the 3D geometry when you are moving a hotspot, but not have it print on the drawing.

 

Thanks,

Scott

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe

@scottjm wrote:

@Barry Kelly - that looks hardcore.  Confirming that when those are visible in the 2D view, they would also print on the drawing?


Yep, if you can see it it will print.

You always have to remember to turn it off.

That is why I prefer the user interface.

 


@scottjm wrote:

What I am specifically attempting to achieve in this instance is with a ceiling services object, being able to move it's 2D ceiling plan symbol and the 3D geometry separately, but still be able to see the position of the outline of the 3D geometry when you are moving a hotspot, but not have it print on the drawing.


Will GLOB_FEEDBACK_MODE help there?

I use that to draw a RECT2 around the text of an object when I am stretching a hotspot to move the text.

It is only visible as you are moving the hotspot.

 

 

 

 

if GLOB_FEEDBACK_MODE = 1 then
	line_type "Solid Line"
	RECT2 -text_wid*0.5,-height*0.5,text_wid*0.5,height*0.5
endif

 

 

 

You would just need to draw something that represents the position of the 3D object.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

@Barry Kelly 's only gone an bloody done it! 😍

That's exactly what I'm looking for!  Thank you so much.

 

Also, for anyone else interest I also looked into using the On-Screen option for Clean Intersections - its an on screen option that people almost never want to turn off, so it could be leveraged as a universal 'Edit mode' toggle.  You just have to remember to turn it back on when you switch the layout view though, so not perfect.

n = REQUEST ("Clean_intersections", "", state)
Returns the state of the Clean Wall & Beam Intersections feature (1 when turned on, 0 when off)

 

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!