Aller au contenu

ApprenticeServer / InventorApprentice


SFX28

Messages recommandés

Bonjour,

 

Je voulais savoir qu'elle est la référence à activer dans le gestionnaire (outils / références) pour pouvoir utiliser les fonctions "Apprentice Server" ?

 

PS : ce n'est pas pour une programmation interne Inventor mais pour "piloter" Inventor à partir d'un prog VB ou Excel par exemple

Autodesk Inventor 2014 SP1

Autodesk AutoCAD 2014

Windows 7 PRO 64 bits SP1

-------------------------------------------------------------------

Station Dell Precision T3610

Intel Xeon E5-1620 v2 3.70 GHz + RAM de 16 Go

Nvidia Quadro K4000 + 2 écrans Dell U2212HM full HD

Lien vers le commentaire
Partager sur d’autres sites

Les ressources en francais doivent être rare mais ici en anglais tu peux trouver des infos.

http://usa.autodesk....4&siteID=123112

Affival SAS - Cored Wire and Wire Feeder for Steel Plant and Foundry Industry

Elficast - Cored Wire for Foundry applications

Autodesk Inventor 2014

Windows 7 64bits

LENOVO W530 - i7-3630QM@2.40GHz - 16Go RAM - QUADRO K1000M

Lien vers le commentaire
Partager sur d’autres sites

Bonjour Guillaume,

 

Désolé pour le temps de réponse mais je suis en plein codage ...

 

En ce qui concerne ta réponse, j'avais un onglet ouvert sur cette page ; nous nous sommes croisés donc. Encore merci de ton aide.

 

Il n'y avait apparemment pas grand chose pour moi mais j'ai ENFIN trouvé les éléments de réponse sur un autre site que tu tout le monde connaît, mais en anglais (comme d'hab !!).

 

Par respect pour CADxp, je ne donne pas le lien (sauf si vous le demandez) mais voici le résumé :

 

you can use VBA with Excel or write a standalone VB program. Use the ApprenticeServer object to manipulate the Inventor document iProperties.

 

below is an example macro for Excel that will allow the user to pick an .idw file, then put all property name-value pairs in a spreadsheet. It is rough, but it should get you pointed in the right direction

 

-----------------------------------------------------------------------

 

 

Public Sub GenerateAllPropertiesList()

 

Dim oSheet As Worksheet

Set oSheet = Application.ActiveSheet

 

Dim fd As FileDialog

Set fd = Application.FileDialog(msoFileDialogFilePicker)

 

Dim vrtSelectedItem As Variant

 

' create Apprentice server for reading iProps

Dim oIV As New InventorApprentice.ApprenticeServerComponent

Dim oIVDoc As InventorApprentice.ApprenticeServerDocument

 

'Use the Show method to display the File Picker dialog box and return the user's action.

'The user pressed the action button.

If fd.Show = -1 Then

 

'Step through each string in the FileDialogSelectedItems collection.

Dim i As Integer

Dim j As Integer

i = 2

j = 1

For Each vrtSelectedItem In fd.SelectedItems

 

Set oIVDoc = oIV.Open(vrtSelectedItem)

 

oSheet.Cells(1, 1) = "Filename"

oSheet.Cells(1, 2) = vrtSelectedItem

 

Dim oPropSet As InventorApprentice.PropertySet

Dim oProp As InventorApprentice.Property

For Each oPropSet In oIVDoc.PropertySets

For Each oProp In oPropSet

oSheet.Cells(i, j) = oProp.Name

 

On Error Resume Next

oSheet.Cells(i, j + 1) = oProp.Value

If Err Then

Err.Clear

oSheet.Cells(i, j + 1) = Str(oProp.Value)

End If

 

i = i + 1

Next oProp

Next oPropSet

Next vrtSelectedItem

End If

 

'Set the object variable to Nothing.

Set fd = Nothing

End Sub

 

 

PS : dans ' create Apprentice server for reading iProps

Dim oIV As New InventorApprentice.ApprenticeServerComponent

Dim oIVDoc As InventorApprentice.ApprenticeServerDocument

 

if faut remplacer InventorApprentice.ApprenticeServerComponent par ApprenticeServerComponent

 

et ça marche, bientôt !!!

 

@+

Autodesk Inventor 2014 SP1

Autodesk AutoCAD 2014

Windows 7 PRO 64 bits SP1

-------------------------------------------------------------------

Station Dell Precision T3610

Intel Xeon E5-1620 v2 3.70 GHz + RAM de 16 Go

Nvidia Quadro K4000 + 2 écrans Dell U2212HM full HD

Lien vers le commentaire
Partager sur d’autres sites

Bonjour Nomutt,

 

Merci beaucoup. Entre-temps, j'ai trouvé à "force de chercher le coté obscure" ! Comme quoi, quand on cherche bien, on trouve. Encore faut-il savoir exactement ce qu'on cherche !

 

@+

Autodesk Inventor 2014 SP1

Autodesk AutoCAD 2014

Windows 7 PRO 64 bits SP1

-------------------------------------------------------------------

Station Dell Precision T3610

Intel Xeon E5-1620 v2 3.70 GHz + RAM de 16 Go

Nvidia Quadro K4000 + 2 écrans Dell U2212HM full HD

Lien vers le commentaire
Partager sur d’autres sites

Créer un compte ou se connecter pour commenter

Vous devez être membre afin de pouvoir déposer un commentaire

Créer un compte

Créez un compte sur notre communauté. C’est facile !

Créer un nouveau compte

Se connecter

Vous avez déjà un compte ? Connectez-vous ici.

Connectez-vous maintenant
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer. Politique de confidentialité