Register  Login   Search
 Latest Posts Minimize

RE: Remove unused Linestyles
Solid Edge Programming
09/03/2010 7:45 AM
jr199

Remove unused Linestyles
Solid Edge Programming
09/02/2010 1:25 PM
kmwolf

How to read block in a dft file without opening the dft file?
Solid Edge Programming
09/02/2010 9:02 AM
assassin.007

Inquire Element - Measure Diameter by VBA
Solid Edge Programming
09/02/2010 6:40 AM
JM

dissolve Reference to SubASM - how to??
Solid Edge Programming
09/02/2010 2:23 AM
LIHE

RE: Using Insight on a 64 bit Computer
Solid Edge General
08/31/2010 7:47 AM
Atom

Using Insight on a 64 bit Computer
Solid Edge General
08/30/2010 3:06 PM
Atom

RE: File Properties using VB.NET leave file locked
Solid Edge Programming
08/30/2010 9:57 AM
JBZ

RE: File Properties using VB.NET leave file locked
Solid Edge Programming
08/30/2010 3:20 AM
jr199

File Properties using VB.NET leave file locked
Solid Edge Programming
08/27/2010 4:36 PM
JBZ

RE: XLS link to the part
Solid Edge Programming
08/27/2010 4:11 PM
JBZ

RE: Save As for each view -- how 2 wait for SE !
Solid Edge Programming
08/27/2010 3:27 AM
jr199

vb6 se20 - solid edge Part - Hole size
Solid Edge Programming
08/26/2010 9:42 PM
cadraw

vb6 se20 - how to Drawing View Depth
Solid Edge Programming
08/26/2010 9:24 PM
cadraw

RE: Problem while getting the objects using "SelectSet" property.
Solid Edge Programming
08/26/2010 7:35 AM
jr199

RE: About the "Callout"!
Solid Edge Programming
08/26/2010 3:42 AM
fatkids

RE: Save As for each view -- how 2 wait for SE !
Solid Edge Programming
08/25/2010 3:28 AM
ErWo

RE: help to transfer C# codes as following to C++ codes?
Solid Edge Programming
08/24/2010 10:12 PM
assassin.007

RE: FamilyMembers Panel problem (refreshing)
Solid Edge Programming
08/24/2010 3:47 PM
peter6396

Save As for each view -- how 2 wait for SE !
Solid Edge Programming
08/24/2010 4:09 AM
LIHE

RE: FamilyMembers Panel problem (refreshing)
Solid Edge Programming
08/24/2010 1:28 AM
ErWo

help to transfer C# codes as following to C++ codes?
Solid Edge Programming
08/23/2010 10:34 PM
assassin.007

Problem while getting the objects using "SelectSet" property.
Solid Edge Programming
08/22/2010 7:59 AM
pratap

FamilyMembers Panel problem (refreshing)
Solid Edge Programming
08/20/2010 4:12 AM
peter6396

RE: AddLoftedFlange in SheetMetal
Solid Edge Programming
08/19/2010 4:33 AM
jason.newell

RE: PartList Positioning
Solid Edge Programming
08/19/2010 2:10 AM
ErWo

RE: Alternate Assemblies
Solid Edge Programming
08/18/2010 4:54 PM
peter6396

RE: About the "Callout"!
Solid Edge Programming
08/18/2010 7:39 AM
Danisan

XLS link to the part
Solid Edge Programming
08/18/2010 5:23 AM
romanes

About the "Callout"!
Solid Edge Programming
08/17/2010 2:49 AM
fatkids


  
 Forums Minimize

Subject: Correct occurence
Prev Next
You are not authorized to post a reply.

Author Messages
Jara CtverakUser is Offline
New Member
New Member
Posts:21

01/11/2010 4:37 AM  
Hello all,
 
I need to compute reference from down to top. This mean for example:
User selects one of screws in assembly and I need to now which one.
Assembly structure can be like this:
 
a
|-b
|  |-c          
|  |  |-screw
|  |  |-screw
|  |
|  |-c          
|    |-screw
|    |-screw
|
|-d
  |-b
    |-c          
    |  |-screw
    |  |-screw
    |
    |-c          
      |-screw
      |-screw
 

So I have selected from user reference of screw. This reference has methods:
 
Object            - occurence of screw
ImmediateParent   - occurence of c-subassembly (but not reference)
Parent            - occurence of c-subassembly (but not reference)
 
"c" subassembly occurence give me only information which of "c" subassemblies it is in "b" subassembly but I don't know which of "b" occurences is parrent of selected screw.
 
Could anybody give an idea how to find correct occurence?
 
Thanks,
Best Regards,
Jara
JRUser is Offline
Site Member
Site Member
Posts:78

01/11/2010 6:53 AM  
Hi Jara,

if you loop the structure from down to top with a reference, you have ImmediateParent as reference, only in toplevel is the ImmadiateParent an occurrence and not reference.

Best Regards
JR
Julian GuilloUser is Offline
SE Guru
Site Member
Site Member
Posts:105

01/11/2010 11:11 AM  

Jara,
I saw you were still asking in the SE newsgroup.

JR gave you the correct answer, and i made a little example for you. It's still VB6 but i hope it's enough.

Just open the a.asm file, select an screw and run the tree.exe app.
You will be able to know which is the "down to top" path and select any intermediate occurrence.

Regards,

Julian

 


Attachment: 1111113518271.zip

Jara CtverakUser is Offline
New Member
New Member
Posts:21

01/19/2010 8:36 AM  
Hello Julian,
 
Thanks to both of you who answered my question I know little bit more how to compute reference.
 
But I still have trouble that last reference I got is from first subaasembly and next immediate parent is occurence of first subassembly. For boolean of screw I need reference of crew in top assembly so i tried compute reference of last assembly level via .CreateReference but it doesn't work.
 
 
 
    public SolidEdgeFramework.Reference getUpRefOfRef(
            SolidEdgeFramework.Reference refDoc, ref int assemLevelsCount)
    {     
      if (refDoc.Type != SolidEdgeFramework.ObjectType.igReference)
      {
        return refDoc;
      }
      else
      {
        SolidEdgeFramework.Reference upRefDoc = null;
 
        try
        {
          upRefDoc =
            (SolidEdgeFramework.Reference)refDoc.ImmediateParent;
        }
        catch
        {
          SolidEdgeAssembly.Occurrence firstSubAssemOcc =
            (SolidEdgeAssembly.Occurrence)refDoc.ImmediateParent;
 
          SolidEdgeAssembly.Occurrences occs =
            (SolidEdgeAssembly.Occurrences)firstSubAssemOcc.Parent;
 
          SolidEdgeAssembly.AssemblyDocument topAssemDoc =
            (SolidEdgeAssembly.AssemblyDocument)occs.Parent;
 
          refDoc = (SolidEdgeFramework.Reference)
            topAssemDoc.CreateReference(firstSubAssemOcc, refDoc);
 
          assemLevelsCount++;
 
          return refDoc;
        }
 
        assemLevelsCount++;
 
        return getUpRefOfRef(upRefDoc, ref assemLevelsCount);
      }
    }
 
 
 
Thanks for any advice.
Best Regards,
Jara
Julian GuilloUser is Offline
SE Guru
Site Member
Site Member
Posts:105

01/19/2010 9:25 AM  
Jara,
What is your objective?
Do you want to substract one of the screws to an existing part at first level in the main assembly?
Just to get an idea of what you want to achieve...
You are not authorized to post a reply.
Forums > Solid Edge > Programming > Correct occurence



ActiveForums 3.7

  

 Users Online Minimize

Membership Membership:
Latest New User Latest: jbazaar
New Today New Today: 1
New Yesterday New Yesterday: 3
User Count Overall: 1968

People Online People Online:
Visitors Visitors: 2
Members Members: 0
Total Total: 2

Online Now Online Now:

  

The Code Project

Spatial Freedom Astroid

Use OpenDNS

Copyright 2010 JasonNewell.NET   Terms Of Use  Privacy Statement