Teddy

Hallo,

Gibt es im Teddy eine Funktion oder einen Befehl mit dem ich die Distanz zwischen zwei ausgewählten Knoten bekomme, welche ich für die weitere Berechnung benötige?

LG!

Hallo,

über @KEY lassen sich die Knotenkoordinaten in Variablen speichern und anschließend weiter verarbeiten.

In etwa so:

+prog template
kopf
let#CDB_IER 0
let#KNNA 1
let#KNNE 2

@KEY NODE
loop
let#NR @NR
if #NR==#KNNA
prt#NR
let#XA @(XYZ+0)
let#YA @(XYZ+1)
let#ZA @(XYZ+2)
prt#XA
prt#YA
prt#ZA
endif
if #NR==#KNNE
prt#NR
let#XE @(XYZ+0)
let#YE @(XYZ+1)
let#ZE @(XYZ+2)
endif

endloop #CDB_IER<2

let#DX (#XE-#XA)
let#DY (#YE-#YA)
let#DZ (#ZE-#ZA)

let#DL (#DX2+#DY2+#DZ2)(0.5)

prt#DL

txa Distanz zwischen Knoten #KNNA und #KNNE: DL = #(DL,12.4)
ende

Viele Grüße

1 Like

In SOFIMSHA kann man die Knotenkoordinaten etwas bequemer mit “GETN nummer[-] VAR KnoKoor” auslesen (x,y,z dann in der Feld-Variablen).
In vielen anderen Modulen geht es auch ohne @key mit “#COOR_X(nummer)” “#COOR_Y(nummer)” “#COOR_Z(nummer)”.

1 Like

Die Möglichkeit mit #COOR_… kannte ich noch nicht. Danke
GETN setzt die Kenntnis der Knotenkoordinaten voraus.
Was in diesem Fall ja nicht bekannt ist.

Viele Grüße

Nein, mit GETN kann man sich (in einem MSHA) zu einem Knoten auch dessen Koordinaten zurückgeben lassen. Dazu darf nur zu X eine Eingabe mit Einheitenangabe “[-]” erfolgen (bei Version 2020; vorher war die Syntax anders) und die Koordinaten werden dann in der Variablen als Feld abgelegt.
Beispiel für einen Knoten 91:
getn 91[-] var A_kor; TXA #(#A_kor(1),5.3) #(#A_kor(2),5.3) #(#A_kor(3),5.3)

Moin,

wieder etwas gelernt :slight_smile:
Nochmals vielen Dank.

Viele Grüße

Vielen Dank!!!

Thank you for the tip.

Here is what Gent said in SofimshA 2020-10 manual:

The input for this record are the coordinates and SOFiMSHA will then
scan the list of objects for a match.

As you said, Gent can also returen coordinates if user input the node number in the format as below:

node number[-]

I couldn’t find this funtion in the manual.
I WISH the official manual describe this useful funtion in the manual in the future !

In an older version it was still described in the manual:

Blockquote
As an alternate input it is possible to request coordinates for a given node number with the
following syntax:
GETN number[-] VAR varname
This will copy the current coordinate values of the node number to the variables varname[IND+1:IND+3] . varname[IND] contains the bit pattern of the support conditions.
Technical Hint: The access from a DLL (CADINP) to data of the calling program is so difficult,
that there is definitely no easier solution available like a direct access to the coordinate arrays
for that purpose.

But today: this rows are away. Don’t ask why, may be, they was shy.

The former syntax in V2016 was: GETN nummer COOR VAR varname