Reply

Opening Assy file props when Assy has alternate Configs

[ Edited ]

 

Hi All

Ummm just a bit stuck. I'm trying to access the file props of an assy that has alternate configs. But i get not valid path.I've tried stripping all the infomation off the end of the file path but still no go

any ideas wood be most welcome 

Sorry it's in VB but i could read between the line if required

Thanks Snow

Set objProps = CreateObject("SolidEdge.FileProperties")

If (objOccurrence.IsFamilyOfAssembly) Then  'check if has alternate assy info attached

    x = 0

    a = 0

    Filename = (objOccurrence.OccurrenceFileName)

    LenFileName = Len(Filename)

    'Filter out junk in file path

    For x = LenFileName To 1 Step -1

        a = a + 1

        Test = Mid(Filename, x, 1)

        If Test = "." Then

            Filename = Mid(Filename, 1, x + 3)

            Debug.Print Filename

        End If

Next x

 Debug.Print Filename   'Check to see what at been stripped

 objProps.Open (Filename)  'Open file ------------------bombs out here

 

 

    Else:

    objProps.Open (objOccurrence.OccurrenceFileName)  'Not a alternate Assy so just open it

End If

 

 

Posted by: Snow Mackenzie
Post date: 9/4/2008 7:28:29 PM

4 REPLIES

RE: Opening Assy file props when Assy has alternate Configs

[ Edited ]

 

Hi Snow,

 

it looks like you're trying to access the properties of a file that is open in Solid Edge. You  can't do that with the SE file properties API - even opening read only won't work.

You could try the Occurrence.Properties property, or you could try my FileProps API (written for VB6 ) here (make sure to set the readonly flag when opening): http://www.jasonnewell.net/Forums/tabid/55/forumid/1/tpage/1/view/topic/postid/831/Default.aspx#831

 

Cheers

Calum

 

Posted by: Calum McLellan
Post date: 9/4/2008 9:22:07 PM

RE: Opening Assy file props when Assy has alternate Configs

[ Edited ]

 

Hi Calum

Yahoo. This might get me right out of the ...Ummm ....well ....4 letter word starts with C and end with P. Might have to shout you a DB when you get back to CHCH

Will keep you posted how I get on

 

Spot  ya

Snow

 

Posted by: Snow Mackenzie
Post date: 9/5/2008 12:15:39 AM

RE: Opening Assy file props when Assy has alternate Configs

[ Edited ]

 

Better make that a monteiths (You can take the coaster out of the coast,... )

 

Posted by: Calum McLellan
Post date: 9/5/2008 12:22:54 AM

RE: Opening Assy file props when Assy has alternate Configs

[ Edited ]

 

Hi Calum

Had massive success with your DLL ,it realy rocks. Now I can open and shut almost anything...

I would e-mail you a  monteiths but i can't seem to fit the bottle in my USB port.

Thanks Again

Snow

 

Posted by: Snow Mackenzie
Post date: 9/5/2008 12:33:08 AM