how to open a file with iLogic and use iProp

how to open a file with iLogic and use iProp

Anonymous
Not applicable
1,484 Views
2 Replies
Message 1 of 3

how to open a file with iLogic and use iProp

Anonymous
Not applicable

Hello

 

Wath am I doing wrong. I want the code to open the file that meets the iProp.

 

But now I get the error message "open is not a member from string"

 

how can I slove this ? the red color is wrong

 

Thanks in advance.

 

 

' Get the active assembly document.
Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
' Iterate through all of the documents referenced by the assembly.
Dim oDoc As Document


For Each oDoc In oAsmDoc.AllReferencedDocuments
' Verify that the document is a part.
If oDoc.DocumentType = kPartDocumentObject Then
Dim oPartDoc As PartDocument = oDoc
'Manipulate part 
Dim model As String = oPartDoc.DisplayName
model = model & ".ipt"

If iProperties.Value(model,"Summary", "subject") = "muppet" Then


MessageBox.Show("je bent zelf een muppet " & model)


model.Open 



Else

MessageBox.Show("Message", "Title")


End If


End If



Next

tnx

 

0 Likes
Accepted solutions (1)
1,485 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

Hi,

 

To open a document the file path of your file should be defined which was not done in your code. I've a modified code of your's which might be helpful.

 

' Get the active assembly document.
Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
' Iterate through all of the documents referenced by the assembly.
Dim oDoc As Document


For Each oDoc In oAsmDoc.AllReferencedDocuments
' Verify that the document is a part.
If oDoc.DocumentType = kPartDocumentObject Then
Dim oPartDoc As PartDocument = oDoc
'Manipulate part 
Dim model As String = oPartDoc.FullFileName


If iProperties.Value(model,"Summary", "subject") = "muppet" Then


MessageBox.Show("je bent zelf een muppet " & model)


ThisApplication.Documents.Open (model)



Else

MessageBox.Show("Message", "Title")


End If


End If



Next
0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution


Dim model As String = oPartDoc.FullFileName Dim emodel As String = oPartDoc.DisplayName emodel = emodel & ".ipt" If iProperties.Value(emodel,"Summary", "subject") = "muppet" Then 'MessageBox.Show("je bent zelf een muppet " & model) Xdoc = ThisApplication.Documents.Open (model,False) Xdoc.rebuild

hello

 

The code did not work bur it helped me to slove the solution above

 

 

thanks for the help

 

0 Likes