Reply

Alternate Assemblies

[ Edited ]

 

Howdy All

What i'm doing is i have written a few macro's that automatically fill out the custom prop's. One on them fills out the part name witch is the active part name (Less the file path). But when it go's to do a family member assy it fill it out incorrectly and sticks .asm!master in the part name. What i wanted to do is to fill out the part name with the member name in it as well eg '1/2 ballvalve (Closed)' or 'Main Chassis (Electric Drive)' Automatically from the active member but I can't get the active FamilyMembers Name

Objdoc.AssemblyFamilyMember.Name 'Doesn't seem to work

If you call the Assy name you get

AssyName.asm!Master 'not the current active FamilyMembers Name

 

But

Debug.Print ObjDoc.AssemblyFamilyMembers.Count 'gets the number of FamilyMembers in the top level assembly

 

Also

Debug.Print ObjDoc.AssemblyFamilyMembers(1).MemberName 'get's the name of the first member (This is what i want ,BUT you have to give it a index number which I don't know how to get from the current active Member)

 

 

nearly forgot.I' using V15

 

Any Ideas?

Snow

 

Posted by: Snow Mackenzie
Post date: 6/11/2008 11:09:34 AM

2 REPLIES

RE: Alternate Assemblies

[ Edited ]

Snow / Anybody Else,

 

Were you ever able to find out which family member was currently active for an assembly? - We now have the same need to know (version 19 and 20) but also still just get returned "assemblyName!Master" with this version, which isn't the greatest of use!

 

Please let us know if you have found a way round this. Using the SolidEdge Spy app I can't see anything obvious which tells us which family member is active, either!

 

Thanks,

Chris.

 

Posted by: chris mann
Post date: 3/12/2009 7:35:05 AM

RE: Alternate Assemblies

[ Edited ]

 

Hello, in hungarian ST2 version work this to find active member of AssemblyFamily:

 

    ...

    Dim sFilename As String

    Dim i As Long

 

    sFilename = Trim(objApp.ActiveWindow.Caption)

    sMemberName = vbNullString

    i = InStrRev(sFilename, "!", -1, vbTextCompare)

    sMemberName = Mid(sFilename, i + 1)    ' isolate member

 

    If Strings.Right(sMemberName, 16) = "][Csak olvasható" Then

      sMemberName = Strings.Left(sMemberName, Len(sMemberName) - 16)

    End If

In english version work?:

    ...

    Dim sFilename As String

    Dim i As Long

 

    sFilename = Trim(objApp.ActiveWindow.Caption)

    sMemberName = vbNullString

    i = InStrRev(sFilename, "!", -1, vbTextCompare)

    sMemberName = Mid(sFilename, i + 1)    ' isolate member

 

    If Strings.Right(sMemberName, 11) = "][Read only" Then

      sMemberName = Strings.Left(sMemberName, Len(sMemberName) - 11)

    End If

 

Sorry for bad english.

 

Peter

 

Posted by: Peter Caderas
Post date: 8/18/2010 11:54:57 AM