Apprentice and File Paths

Apprentice and File Paths

Anonymous
Not applicable
290 Views
4 Replies
Message 1 of 5

Apprentice and File Paths

Anonymous
Not applicable
My first foray into Apprentice server so bear with me.

Using the Assembly tree example as a staring point I have added a click even
to the tree view. I return the display name of the file (which is the same
as the filename in my case).

I now want to find the full path of the selected file based upon the current
project file.

I don't see a way to find the full path of the file unless I load the
document into apprentice (which I will do AFTER I find the full path).
Chicken and the egg...

Any suggestions?

--
Sean Dotson, PE
http://www.sdotson.com
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
-----------------------------------------------------------------------
0 Likes
291 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
You need to look at the referencedfiles... This will loop through the
entire assembly.

Dim odoc As ApprenticeServerDocument
Set odoc = oApprenticeApp.Open("C:\Test.iam")
If odoc.DocumentType = kAssemblyDocumentObject Then
Call GetSub(odoc)
End If


Sub GetSub(subdoc As ApprenticeServerDocument)
For i = 1 To subdoc.ReferencedFiles.Count
stName= subdoc.ReferencedFiles.Item(i).FullFileName
If subdoc.ReferencedFiles.Item(i).DocumentType =
kAssemblyDocumentObject Then
Call GetSub(subdoc.ReferencedFiles.Item(i))
End If
Next i
End Sub


"Sean Dotson" wrote in message
news:510D188ED957876F41431F9CFAC9541B@in.WebX.maYIadrTaRb...
> My first foray into Apprentice server so bear with me.
>
> Using the Assembly tree example as a staring point I have added a click
even
> to the tree view. I return the display name of the file (which is the
same
> as the filename in my case).
>
> I now want to find the full path of the selected file based upon the
current
> project file.
>
> I don't see a way to find the full path of the file unless I load the
> document into apprentice (which I will do AFTER I find the full path).
> Chicken and the egg...
>
> Any suggestions?
>
> --
> Sean Dotson, PE
> http://www.sdotson.com
> Check the Inventor FAQ for most common questions
> www.sdotson.com/faq.html
> -----------------------------------------------------------------------
>
>
0 Likes
Message 3 of 5

Anonymous
Not applicable
Without trying a few things, I think what you will probably need to do is to set a
reference to the assembly upper assembly and then find the occurrence name in the assembly
and set a reference to it.

something like this

Dim odoc As ApprenticeServerDocument
Set odoc = oApprenticeApp.Open(txtFilename.Text)
Dim sFilename As String
sFilename = treList.SelectedItem

Then find the instance that matches sFilename..... I imagine you will have to compare
against the parent tree nodes also?? to be sure to get into the right sub.


Does that make sense?

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Sean Dotson" wrote in message
news:510D188ED957876F41431F9CFAC9541B@in.WebX.maYIadrTaRb...
> My first foray into Apprentice server so bear with me.
>
> Using the Assembly tree example as a staring point I have added a click even
> to the tree view. I return the display name of the file (which is the same
> as the filename in my case).
>
> I now want to find the full path of the selected file based upon the current
> project file.
>
> I don't see a way to find the full path of the file unless I load the
> document into apprentice (which I will do AFTER I find the full path).
> Chicken and the egg...
>
> Any suggestions?
>
> --
> Sean Dotson, PE
> http://www.sdotson.com
> Check the Inventor FAQ for most common questions
> www.sdotson.com/faq.html
> -----------------------------------------------------------------------
>
>
0 Likes
Message 4 of 5

Anonymous
Not applicable
Referenced File... That's what I needed Kathy. Thanks...

--
Sean Dotson, PE
http://www.sdotson.com
Check the Inventor FAQ for most common questions
www.sdotson.com/faq.html
-----------------------------------------------------------------------
"KJohnson" wrote in message
news:DE7047AAE78C5C91DD96B54560AE729F@in.WebX.maYIadrTaRb...
> You need to look at the referencedfiles... This will loop through the
> entire assembly.
>
> Dim odoc As ApprenticeServerDocument
> Set odoc = oApprenticeApp.Open("C:\Test.iam")
> If odoc.DocumentType = kAssemblyDocumentObject Then
> Call GetSub(odoc)
> End If
>
>
> Sub GetSub(subdoc As ApprenticeServerDocument)
> For i = 1 To subdoc.ReferencedFiles.Count
> stName= subdoc.ReferencedFiles.Item(i).FullFileName
> If subdoc.ReferencedFiles.Item(i).DocumentType =
> kAssemblyDocumentObject Then
> Call GetSub(subdoc.ReferencedFiles.Item(i))
> End If
> Next i
> End Sub
>
>
> "Sean Dotson" wrote in message
> news:510D188ED957876F41431F9CFAC9541B@in.WebX.maYIadrTaRb...
> > My first foray into Apprentice server so bear with me.
> >
> > Using the Assembly tree example as a staring point I have added a click
> even
> > to the tree view. I return the display name of the file (which is the
> same
> > as the filename in my case).
> >
> > I now want to find the full path of the selected file based upon the
> current
> > project file.
> >
> > I don't see a way to find the full path of the file unless I load the
> > document into apprentice (which I will do AFTER I find the full path).
> > Chicken and the egg...
> >
> > Any suggestions?
> >
> > --
> > Sean Dotson, PE
> > http://www.sdotson.com
> > Check the Inventor FAQ for most common questions
> > www.sdotson.com/faq.html
> > -----------------------------------------------------------------------
> >
> >
>
>
0 Likes
Message 5 of 5

Anonymous
Not applicable
No problem.

Kathy Johnson

"Sean Dotson" wrote in message
news:2556D6C642F9E4E85FBA71B3AD434C3D@in.WebX.maYIadrTaRb...
> Referenced File... That's what I needed Kathy. Thanks...
>
> --
> Sean Dotson, PE
> http://www.sdotson.com
> Check the Inventor FAQ for most common questions
> www.sdotson.com/faq.html
> -----------------------------------------------------------------------
> "KJohnson" wrote in message
> news:DE7047AAE78C5C91DD96B54560AE729F@in.WebX.maYIadrTaRb...
> > You need to look at the referencedfiles... This will loop through the
> > entire assembly.
> >
> > Dim odoc As ApprenticeServerDocument
> > Set odoc = oApprenticeApp.Open("C:\Test.iam")
> > If odoc.DocumentType = kAssemblyDocumentObject Then
> > Call GetSub(odoc)
> > End If
> >
> >
> > Sub GetSub(subdoc As ApprenticeServerDocument)
> > For i = 1 To subdoc.ReferencedFiles.Count
> > stName= subdoc.ReferencedFiles.Item(i).FullFileName
> > If subdoc.ReferencedFiles.Item(i).DocumentType =
> > kAssemblyDocumentObject Then
> > Call GetSub(subdoc.ReferencedFiles.Item(i))
> > End If
> > Next i
> > End Sub
> >
> >
> > "Sean Dotson" wrote in message
> > news:510D188ED957876F41431F9CFAC9541B@in.WebX.maYIadrTaRb...
> > > My first foray into Apprentice server so bear with me.
> > >
> > > Using the Assembly tree example as a staring point I have added a
click
> > even
> > > to the tree view. I return the display name of the file (which is the
> > same
> > > as the filename in my case).
> > >
> > > I now want to find the full path of the selected file based upon the
> > current
> > > project file.
> > >
> > > I don't see a way to find the full path of the file unless I load the
> > > document into apprentice (which I will do AFTER I find the full path).
> > > Chicken and the egg...
> > >
> > > Any suggestions?
> > >
> > > --
> > > Sean Dotson, PE
> > > http://www.sdotson.com
> > > Check the Inventor FAQ for most common questions
> > > www.sdotson.com/faq.html
> >
> -----------------------------------------------------------------------
> > >
> > >
> >
> >
>
>
0 Likes