Tuesday, February 07, 2012
Alternate Assemblies
Last Post 18 Aug 2010 04:54 PM by peter6396. 2 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Snow MackenzieUser is Offline
New Member
New Member
Posts:39

--
11 Jun 2008 04:09 PM  

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

chris mannUser is Offline
New Member
New Member
Posts:33

--
12 Mar 2009 12:35 PM  
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.
peter6396User is Offline
New Member
New Member
Posts:7

--
18 Aug 2010 04:54 PM  

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

You are not authorized to post a reply.

Active Forums 4.2
Copyright © 2011 JasonNewell.NET