modify height in TORISPHERICHEAD script in Python

modify height in TORISPHERICHEAD script in Python

ing_hcjp
Contributor Contributor
347 Views
8 Replies
Message 1 of 9

modify height in TORISPHERICHEAD script in Python

ing_hcjp
Contributor
Contributor

Greetings engineers
Could you help me on how I modify the height "H" of the operation [modify height in TORISPHERICHEAD ] in Python

I start from the command: [s=TORISPERICHEAD(s, R) ], but I have not been able to modify the height using the command [obj.parameters() ] Could you help me how to write the statement to change my height (H).
thank you

0 Likes
348 Views
8 Replies
Replies (8)
Message 2 of 9

ing_hcjp
Contributor
Contributor

L=E
C4 = TORISPHERICHEADH(s, R=DE/2.0).rotateY(180).translate((0.0, 0.0, -DE/2.0))
vT = C4.parameters()
vTH = float(vT['H'])
if L + vTH < 0.0:
C4.erase()
C4 = TORISPHERICHEADH(s, R=DE/2.0, H=L).rotateY(180).translate((0.0, 0.0, -DE/2.0))

 

<<<<<I USED THIS STATEMENT BUT IT DID NOT WORK FOR ME>>>>>

0 Likes
Message 3 of 9

h_eger
Mentor
Mentor

@ing_hcjp ,

 

have you defined the value ‘H’?

 

21-02-2025_13-11-31.jpg

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



0 Likes
Message 4 of 9

ing_hcjp
Contributor
Contributor

It's right; I changed to only using that form but when doing "Testascript" I get an error for null parameters, from there I checked the parameters option but I have not been able to modify the height, I get 1/4 of the Diameter in the usual way

 

C4 = TORISPHERICHEADH(s, R=DE/2.0, H=L).rotateY(180).translate((0.0, 0.0, -DE/2.0))

 

DE=2.5"

L=0.273

0 Likes
Message 5 of 9

h_eger
Mentor
Mentor

can you also upload the complete content of your script?

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



0 Likes
Message 6 of 9

hendshiwa
Community Visitor
Community Visitor

How can you modify the height "H" in the TORISPHERICHEAD operation using Python? I'm starting with the command s=TORISPHERICHEAD(s, R), but I'm having trouble changing the height with obj.parameters(). What's the correct way to write the statement to adjust the height?

0 Likes
Message 7 of 9

ing_hcjp
Contributor
Contributor

Greetings engineer.
try this command :TORISPHERICHEADH(s, R=DE/2.0, H=L)
it didn't work for me but it did for several people on the forum. If I find another solution I will post it in this chat.

 

 

TORISPHERICHEADH(s, R=DE/2.0, H=L)

0 Likes
Message 8 of 9

matt.worland
Advisor
Advisor

Hello @ing_hcjp,

Line 2 and 7 of your shown code are both calling the torisphericheadmethod, but on line 2, you are not giving it an 'H' argument.

If you are not passing in an 'H', then you should use the torispherichead or torispherichead2 method


Also ensure your 'L' has a value, you don't show where 'E' is getting set, and for that matter, why not just use 'E' since you are not modifying 'L'

 

As @h_eger mentioned, showing the full code helps quite a bit, otherwise, we are just guessing.

If my reply was helpful, please give a "Thumbs Up" or "Accept as Solution"
Message 9 of 9

h_eger
Mentor
Mentor

@elbertdue ,

 

perhaps you could try reading! The post above explains what you need to use to make ‘H’ work

 

s = TORISPHERICHEADH(s, R, H)

 

 

-

If my reply was helpful, please give a "Kudo" or click the "Accept as Solution" button below (or both).

Hartmut Eger
Senior Engineer
Anlagenplanung + Elektotechnik
XING | LinkedIn

EESignature



0 Likes