Hallo Zusammen
Kann man in einem Smartpart im 2D-Script eine Ellipse erstellen? Wenn ja, wie?
Kann ich dann im 3D-Script daraus einen Körper extrudieren?
Vielen Dank für eure Hilfe
yarn
- Forum
- CAD Parametrische Modellierung
- CAD SmartParts
[Frage] Ellipse per Smartpart [Gelöst]
Lösung anzeigen Lösung verbergen
..man kann auch die elliptischen Punkte gleich mit 2 Radien konstruieren.
Dann lässt sich die Form von Boden- und Deck-Fläche separat steuern
Anhänge (2)
Hi Nemo, please look this script and attachment. How can I do with handle for modify like the red line?
REF_HANDLES
id = 1
HANDLE 0 , 0 , 0 , id , "h" , 1 !base
HANDLE 0 , 0 ,h , id , "h" , 2 !move
HANDLE 0 , 0 , -1 , id , "h" , 3 !ref
id = id + 1
HANDLE REF_X / 2 , 0 , 0 , id , "s" , 1 !base
HANDLE REF_X / 2 , s , 0 , id , "s" , 2 !move
HANDLE REF_X / 2 , -1 , 0 , id , "s" , 3 !ref
id = id + 1
GROUP "dx"
TUBE 10 , 5 , 1 + 2 ,
! section
0 , 0 , 0 ,
-s , 0 , 0 ,
-s , h1 + s1 , 900 , !center
-s , h1 , 0 , !start
-s , 90 , 4000 , !arrive
-s + s1 + s2 , h - r - h2 , 0 ,
-s + s1 + s2 , h , 900 , !center
-s + s1 + s2 , h - r , 0 , !start
-s + s1 + s2 , 90 , 4000 , !arrive
0 , h , 0 ,
!path
0 , 1 , 0 , 0 ,
0 , 0 , 0 , 0 ,
REF_X , 0 , 0 , 0 ,
REF_X , REF_Y , 0 , 0 ,
0 , REF_Y , 0 , 0
GROUP_END
GROUP "sx"
TUBE 10 , 5 , 1 + 2 ,
!section
0 , 0 , 0 ,
-s , 0 , 0 ,
-s , h1 + s1 , 900 , !center
-s , h1 , 0 , !start
-s , 90 , 4000 , !arrive
-s + s1 + s2 , h - r - h2 , 0 ,
-s + s1 + s2 , h , 900 , !center
-s + s1 + s2 , h - r , 0 , !start
-s + s1 + s2 , 90 , 4000 , !arrive
0 , h , 0 ,
!path
REF_X , 0 , 0 , 0 ,
REF_X , REF_Y , 0 , 0 ,
0 , REF_Y , 0 , 0 ,
0 , 0 , 0 , 0 ,
1 , 0 , 0 , 0
GROUP_END
GROUP "int"
BOX REF_X , REF_Y , h
GROUP_END
result = ""
result = GROUP_UNION ( "dx" , "sx" )
result = GROUP_UNION ( result , "int" )
GROUP_PLACE result
Anhänge (1)
You've lost track of!
Some general hints:
- Realize, what are dependent values!
In your sketch h1 is dependend: h1 = h - r - h2 - s1
the same s: s = s1 + s2 + r
- Use reference parameters (ref_x,ref_y,ref_z) for overall dimensions
and calculate the the dependend values!
For instance the dimensions of the inner box are:
bx = REF_X - 2 * s
by = REF_Y - 2 * s
- Create the handles in the correct direction of action!
Not make handles for dependend values!
It is a double stacked form!
Create a subroutine for creating one of this, an call it twice with other parameters!
Anhänge (2)
Some general hints:
- Realize, what are dependent values!
In your sketch h1 is dependend: h1 = h - r - h2 - s1
the same s: s = s1 + s2 + r
- Use reference parameters (ref_x,ref_y,ref_z) for overall dimensions
and calculate the the dependend values!
For instance the dimensions of the inner box are:
bx = REF_X - 2 * s
by = REF_Y - 2 * s
- Create the handles in the correct direction of action!
Not make handles for dependend values!
It is a double stacked form!
Create a subroutine for creating one of this, an call it twice with other parameters!
Thank you very much for information!!
Some general hints:
- Realize, what are dependent values!
In your sketch h1 is dependend: h1 = h - r - h2 - s1
the same s: s = s1 + s2 + r
- Use reference parameters (ref_x,ref_y,ref_z) for overall dimensions
and calculate the the dependend values!
For instance the dimensions of the inner box are:
bx = REF_X - 2 * s
by = REF_Y - 2 * s
- Create the handles in the correct direction of action!
Not make handles for dependend values!
It is a double stacked form!
Create a subroutine for creating one of this, an call it twice with other parameters!
Hi Nemo, Your script is good but I want modify h1 also with insert value ....when I insert my new value of h1 the form 3d changes automatically. Thank You.
Again: h1 is dependend, if all other values are paramters: h1 = h - r - h2 - s1
It's yours to make h1 independent e.g. by remove input possibility for h2, and make h2 dependent!
You have to decide, what should happen, if h1 is modified!
Should r, h2 and s1 modified simultaneously, or only one of them! Assumed that h should not changed!
To calculate the dependent parameters seperatly for h1 and the others, do this in parameter-script:
IF GLOB_MODPAR_NAME="h1" THEN
h2 = h - r - h1 - s1 !h2 should change
PARAMETERS h2 = h2
ENDIF
IF GLOB_MODPAR_NAME="r" OR GLOB_MODPAR_NAME="h2" OR GLOB_MODPAR_NAME="s1" THEN
h1 = h - r - h2 - s1 !h1 should change
PARAMETERS h1 = h1
ENDIF
Then you cann add "h1" as parameter with a current valid value, so that h = h1 + r + h2 + s1 is fulfilled!
With this t each change of one of the parameters, the other dependen parameters are recalculated!
Please open e new post next time!
The topic "Ellipse per SmartPart" is no longer relevant!
It's yours to make h1 independent e.g. by remove input possibility for h2, and make h2 dependent!
You have to decide, what should happen, if h1 is modified!
Should r, h2 and s1 modified simultaneously, or only one of them! Assumed that h should not changed!
To calculate the dependent parameters seperatly for h1 and the others, do this in parameter-script:
IF GLOB_MODPAR_NAME="h1" THEN
h2 = h - r - h1 - s1 !h2 should change
PARAMETERS h2 = h2
ENDIF
IF GLOB_MODPAR_NAME="r" OR GLOB_MODPAR_NAME="h2" OR GLOB_MODPAR_NAME="s1" THEN
h1 = h - r - h2 - s1 !h1 should change
PARAMETERS h1 = h1
ENDIF
Then you cann add "h1" as parameter with a current valid value, so that h = h1 + r + h2 + s1 is fulfilled!
With this t each change of one of the parameters, the other dependen parameters are recalculated!
Please open e new post next time!
The topic "Ellipse per SmartPart" is no longer relevant!
Thank you very much for information Nemo. Sorry...next time I open a new post ! Goodbye!