Génération automatique de paramètre
Fermé
Milou52
-
4 déc. 2012 à 13:15
lermite222 Messages postés 8724 Date d'inscription dimanche 8 avril 2007 Statut Contributeur Dernière intervention 22 janvier 2020 - 4 déc. 2012 à 23:05
lermite222 Messages postés 8724 Date d'inscription dimanche 8 avril 2007 Statut Contributeur Dernière intervention 22 janvier 2020 - 4 déc. 2012 à 23:05
A voir également:
- Génération automatique de paramètre
- Recherche automatique des chaînes ne fonctionne pas - Guide
- Logiciel de sauvegarde automatique gratuit - Guide
- Message automatique thunderbird - Guide
- Remettre parametre usine pc - Guide
- Parametre windows - Guide
5 réponses
lermite222
Messages postés
8724
Date d'inscription
dimanche 8 avril 2007
Statut
Contributeur
Dernière intervention
22 janvier 2020
1 191
4 déc. 2012 à 13:20
4 déc. 2012 à 13:20
Bonjour,
Huuummm plus claire que ça tu meure :DD
Essaye d'expliquer un peu mieux Stp, avec un exemple concret si possible.
A+
Huuummm plus claire que ça tu meure :DD
Essaye d'expliquer un peu mieux Stp, avec un exemple concret si possible.
A+
J'ai besoin d'un nombre inconnu de paramètre dans un code, dans l'idéal il faudrait que je puisse avoir une boucle du type :
For i=1 to n
param.i = "création param"
Next
si n vaut 3 j'obtiendrai
param.1
param.2
param.3
For i=1 to n
param.i = "création param"
Next
si n vaut 3 j'obtiendrai
param.1
param.2
param.3
lermite222
Messages postés
8724
Date d'inscription
dimanche 8 avril 2007
Statut
Contributeur
Dernière intervention
22 janvier 2020
1 191
4 déc. 2012 à 13:53
4 déc. 2012 à 13:53
Tes paramètres y ressemble à quoi ?
mais une piste..
Difficile de faire mieux sans renseignement concret.
A+
mais une piste..
Sub Essais() Dim n As Integer, i As Integer Dim Param() 'pour le test n = 3 ReDim Param(n) For i = 1 To n Param(i) = "Param " & i Next i End Sub
Difficile de faire mieux sans renseignement concret.
A+
Puisque tu insistes je vais te mettre un morceau de code :
Sub CATMain()
[...]
'Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromObject(hybridShapePlaneOffset1)
'Dim hybridShapeIntersection1 As HybridShapeIntersection
Set hybridShapeIntersection1 = hybridShapes1.Item("Intersection.25")
'Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromObject(hybridShapeIntersection1)
hybridShapeSpline1.AddPointWithConstraintExplicit reference2, Nothing, -1#, 1, Nothing, 0#
'Dim hybridShapeIntersection2 As HybridShapeIntersection
Set hybridShapeIntersection2 = hybridShapes1.Item("Intersection.26")
'Dim reference3 As Reference
Set reference3 = part1.CreateReferenceFromObject(hybridShapeIntersection2)
hybridShapeSpline1.AddPointWithConstraintExplicit reference3, Nothing, -1#, 1, Nothing, 0#
'Dim hybridShapeIntersection3 As HybridShapeIntersection
Set hybridShapeIntersection3 = hybridShapes1.Item("Intersection.27")
hybridShapeSpline1.AddPointWithConstraintExplicit reference3, Nothing, -1#, 1, Nothing, 0#
body1.InsertHybridShape hybridShapeSpline1
part1.InWorkObject = hybridShapeSpline1
part1.Update
End Sub
Je travaille sous CATIA, une fonction sert à créer une droite en reliant des points. Chaque point semble être stocké dans la variable "reference1", 2 ,3. je souhaite automatiser la sélection des points, leur nombre total est n. Je ne sais donc pas à l'avance combien créer de paramètre "référence" ...
Sub CATMain()
[...]
'Dim reference1 As Reference
Set reference1 = part1.CreateReferenceFromObject(hybridShapePlaneOffset1)
'Dim hybridShapeIntersection1 As HybridShapeIntersection
Set hybridShapeIntersection1 = hybridShapes1.Item("Intersection.25")
'Dim reference2 As Reference
Set reference2 = part1.CreateReferenceFromObject(hybridShapeIntersection1)
hybridShapeSpline1.AddPointWithConstraintExplicit reference2, Nothing, -1#, 1, Nothing, 0#
'Dim hybridShapeIntersection2 As HybridShapeIntersection
Set hybridShapeIntersection2 = hybridShapes1.Item("Intersection.26")
'Dim reference3 As Reference
Set reference3 = part1.CreateReferenceFromObject(hybridShapeIntersection2)
hybridShapeSpline1.AddPointWithConstraintExplicit reference3, Nothing, -1#, 1, Nothing, 0#
'Dim hybridShapeIntersection3 As HybridShapeIntersection
Set hybridShapeIntersection3 = hybridShapes1.Item("Intersection.27")
hybridShapeSpline1.AddPointWithConstraintExplicit reference3, Nothing, -1#, 1, Nothing, 0#
body1.InsertHybridShape hybridShapeSpline1
part1.InWorkObject = hybridShapeSpline1
part1.Update
End Sub
Je travaille sous CATIA, une fonction sert à créer une droite en reliant des points. Chaque point semble être stocké dans la variable "reference1", 2 ,3. je souhaite automatiser la sélection des points, leur nombre total est n. Je ne sais donc pas à l'avance combien créer de paramètre "référence" ...
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
lermite222
Messages postés
8724
Date d'inscription
dimanche 8 avril 2007
Statut
Contributeur
Dernière intervention
22 janvier 2020
1 191
4 déc. 2012 à 23:05
4 déc. 2012 à 23:05
Je te rappel que tu est dans le forum VB?
Je comprend rien à ton code.
Je laisse la place
A+
PS: ton titre aurait dû être plus clair.
Je comprend rien à ton code.
Je laisse la place
A+
PS: ton titre aurait dû être plus clair.