Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Measure distance between two points - command

Anonymous
Not applicable
Hi,

Quick simple question.

Is there a command allowing to quickly measure distance between two points defined by X and Y?
.... something like this "DIST":

DIST 10, 20, 30, 50 , distance

PRINT distance != 36,1

If there no such command than is there a simpler method than this? :

distance = sqr( (30-10)*(30-10) + (50-20)*(50-20) )
5 REPLIES 5
sinceV6
Advocate
philips wrote:
Hi,

Quick simple question.

Is there a command allowing to quickly measure distance between two points defined by X and Y?
.... something like this "DIST":

DIST 10, 20, 30, 50 , distance

PRINT distance != 36,1
Hello.

No.

Or none that I'm aware of.
Finding the hypotenuse is the simple way of knowing the distance between two points.

philips wrote:
If there no such command than is there a simpler method than this? :

distance = sqr( (30-10)*(30-10) + (50-20)*(50-20) )
You could only simplify with:

distance = sqr(  (30-10)^2 + (50-20)^2 )
or

distance = sqr(  (30-10)**2 + (50-20)**2 )
but that's about it.

Best regards.
Anonymous
Not applicable
It would be really nice to have such a command, especially when it comes to measuring distance between two points defined in 3D by X, Y, Z.

Measuring is very useful when trying to do such a thing (point attracted cones):
screen.JPG
Anonymous
Not applicable
Hi,
you can always use a subroutine with some variables to store input and output or a macro object with seven parameters, six input and a returned parameter for the result.
Anonymous
Not applicable
Basically, for measuring distance in 3D, its not that difficult as it is:
 
distance = sqr ( (x2-x1)^2 + (y2-y1)^2 + (z2 - z1)^2 ) 


but still it would be nice to make it more simple.

Next question:

Is it possible to request position of any other object selected by its unique ID?
What I'm thinking of is to treat a secondary object outside the GDL object to work as a attractor influencing parameters of this GDL Object...

For the above example I used a moveable hotspot inside the GDL Object as the attractor. This is why I can make many options of it a few seconds:
Przechwytywanie 2.JPG
Laszlo Nagy
Community Admin
Community Admin
GDL Objects cannot be aware of each other directly, there is no such functionality as far as I know.
I don't know if the following could be done but one object could write the information needed by the other object into a file, and the other object could read it.
After the first object wrote the data, you would probably have to regenerate the other object to read the data from the file.
But I don't know if this would work as I have not tried it myself, it is just an idea.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac28