Register  Login   Search
 Latest Posts Minimize

RE: Through the program to create a square tube???
Solid Edge Programming
03/10/2010 2:58 AM
fatkids

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/09/2010 3:55 AM
wksyspro

SEpartX crashs VB6
Solid Edge Programming
03/08/2010 8:38 AM
ara

Assembly instances not supported
Solid Edge General
03/07/2010 8:10 PM
cadourian

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/06/2010 2:44 PM
tirolerover40

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/06/2010 4:06 AM
wksyspro

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/05/2010 2:35 PM
tirolerover40

RE: .Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/05/2010 11:36 AM
wksyspro

How to add menu to the QuickAccessToolbar
Solid Edge Programming
03/05/2010 4:57 AM
TomasV

Save sketched profile
Solid Edge Programming
03/04/2010 9:42 AM
Autoit

Use Isotable.dll with ST2 64bits
Solid Edge Programming
03/04/2010 7:22 AM
sinex

.Net: print of dwg files as pdf scaling problem
Solid Edge Programming
03/03/2010 3:03 PM
tirolerover40

How to get the threadFeature information from CopiedPart?
Solid Edge Programming
03/01/2010 5:36 AM
Julia

RE: How to read, from a draft, the file properties of the part / assembly
Solid Edge Programming
02/26/2010 8:18 AM
mdrummond

Assy Oeration Property
Solid Edge Programming
02/26/2010 8:13 AM
mdrummond

How the expansion of the Engineering Reference?
Solid Edge Programming
02/25/2010 8:35 PM
fatkids

RE: problems with creating toolbar
Solid Edge Programming
02/25/2010 11:39 AM
Nika_Neugier

Crash editing blocklabeloccurrence value
Solid Edge Programming
02/25/2010 2:55 AM
Tymen

problems with creating toolbar
Solid Edge Programming
02/24/2010 5:43 AM
Nika_Neugier

RE: Convert .dft to .dxf
Solid Edge Programming
02/23/2010 1:11 PM
jvelasco

RE: Internal Error: Invalid Status 0x248
Solid Edge General
02/22/2010 8:46 AM
catamayo

how to get mouse click event of the view of the SEPreview.ocx
Solid Edge Programming
02/21/2010 7:29 PM
wei

how to use the SEPreview.ocx
Solid Edge Programming
02/20/2010 2:41 AM
wei

Solid Edge / Insight BOM Extraction
Solid Edge Programming
02/18/2010 9:14 AM
alspaughja

How to set FaceStyle for face in occurrence?
Solid Edge Programming
02/18/2010 1:08 AM
jurajjoob

How to set Occurrence.FaceStyle to (Use Part Style) or (None)?
Solid Edge Programming
02/17/2010 2:42 PM
jurajjoob

RE: Exception when calling....
Solid Edge Programming
02/17/2010 8:03 AM
boman

Edit occurrence in place
Solid Edge Programming
02/17/2010 5:35 AM
Tymen

Getting part surface from assembly surface
Solid Edge Programming
02/16/2010 3:18 AM
Serge

RE: Need basic CNC info please
Solid Edge General
02/16/2010 12:20 AM
jr199


  
 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:20

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:57

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:95

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:20

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:95

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: simoned
New Today New Today: 0
New Yesterday New Yesterday: 5
User Count Overall: 1779

People Online People Online:
Visitors Visitors: 1
Members Members: 0
Total Total: 1

Online Now Online Now:

  

Siemens PLM Connection

JasonNewell.NET on Facebook

The Code Project

Spatial Freedom Astroid

Use OpenDNS

Copyright 2008 JasonNewell.NET   Terms Of Use  Privacy Statement