$PRP ---> Excel

Bonjour From France , Hello,

Sorry for my English....

I have many file of template, and i'll like to take property ($PRP) and put them into Excel.

I Know how to read evry Files and how to open Soliworks by VBA but I don't know how to read $PRP..

Thank you to help me.....

Email : snipped-for-privacy@optimum-conseil.com

Reply to
c.sonneck
Loading thread data ...

I don't think it is accessable. You can search for a note with the text that it should have or you can rename the notes on the template and search for them by name.

'You can pass an string to this function to rename a selected note with that string.

Function SetNoteName(NewName As String)

Dim MyNote As SldWorks.note Dim FoundMyNote As Boolean Dim SelMgr As SldWorks.SelectionMgr Dim LPCALLOUT As Callout Dim userName As String

Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc Set Part1 = Part.Extension

' Get the selection manager class

Set SelMgr = Part.SelectionManager()

' If user has selected something

If (SelMgr.GetSelectedObjectCount 0) Then

' Get the first item in the selection list

Set MyNote = SelMgr.GetSelectedObject2(1)

' If selected object is a note

If (SelMgr.GetSelectedObjectType(1) = 15) Then

' Change the name of the note

ret = MyNote.SetName(NewName)

' End if selected object was note or not

End If

Else MsgBox "There is nothing selected" End ' End if there is an object selected

End If

End Function

'Then you can get the text of the Note you just renamed with this function

Function GetNotesTextByName(NoteName As String) As String

Dim count As Integer

Set swApp = Application.SldWorks Set Part = swApp.ActiveDoc Set swSheet = Part.GetCurrentSheet()

Get_User_Name.GetUserName

Set swView = Part.GetFirstView Set swNote = swView.GetFirstNote

'search all text in drawing for one with the passed name While Not swNote Is Nothing If swNote.GetName = NoteName Then GetNotesTextByName = swNote.GetText Exit Function End If Set swNote = swNote.GetNext Wend

MsgBox "A note with the name " & VBA.Chr(34) & NoteName & VBA.Chr(34) & " was not found on this sheet."

End Function

Reply to
Corey Scheich

oops delete this out of that code

Get_User_Name.GetUserName

Reply to
Corey Scheich

Thank you............. I done this and it's OK........

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

Public Sub Lire_Fonds_Plan()

Const swDocDRAWING = 3

Dim swApp As Object Dim SelMgr As Object Dim Nb_Prop As Long Dim La_Liste As Variant

Set swApp = CreateObject("SldWorks.Application")

Set Model = swApp.ActiveDoc

'Edition des plans uniquement..... If (Model Is Nothing) Or (Model.GetType swDocDRAWING) Then Exit Sub End If

'Trouve le nombre de propriétés Nb_Prop = Model.GetCustomInfoCount2(configuration) 'Extrait la liste des propriétés dans une liste (tableau) La_Liste = Model.GetCustomInfoNames() '(configuration) For T = 0 To Nb_Prop - 1 Step 1 Debug.Print T + 1, La_Liste(T), Model.CustomInfo2(configuration, La_Liste(T)) Next T

End Sub

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

"Corey Scheich" a écrit dans le message de news: bntrm2$14q210$ snipped-for-privacy@ID-200385.news.uni-berlin.de...

VBA.Chr(34)

Reply to
c.sonneck

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.