Register  Login   Search
 Latest Posts Minimize

How to ask values in mm?
Solid Edge Programming
03/11/2010 12:26 AM
jurajjoob

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


  
 Forums Minimize

Subject: How to create Assembly Patterns?
Prev Next
You are not authorized to post a reply.

Author Messages
SergeyUser is Offline
New Member
New Member
Posts:8

01/13/2010 4:57 AM  

From the API reference it is not clear how to use function AssemblyPatterns.Create( PatternName, MasterOccurrences, FeaturePattern, ReferenceFeature) and what arguments to pass.
I used the following sample in VB to create a new AssemblyPattern but it always failed.

Dim objOccArray(1 To 1) As Object
Set objOccArray(1) = objAssmDoc.Occurrences(2)
Dim Occ As SolidEdgeAssembly.Occurrence
Occ = objAssmDoc.Occurrences(1)
Dim objPart As SolidEdgePart.PartDocument
objPart = Occ.OccurrenceDocument       
objPattern = objPart.Models(1).Patterns.Item(1)
HoleObj = objPart.Models(1).Holes(1)

objAsmPattern = objAssmDoc.AssemblyPatterns.Create("MyPattern", objOccArray, objPattern, HoleObj) 

I also tried to get parameters from already existing AssemblyPattern and used them to create another AssemblyPattern. To get parameters I used function AssemblyPatterns.GetInputs( ... ). Then I deleted the old AssemblyPattern and tried to create a new one using the retrieved parameters. But AssemblyPatterns.Create(...)  failed again.

Thanks

JRUser is Offline
Site Member
Site Member
Posts:57

01/18/2010 5:47 AM  

Hi Sergey,

your way is good, but your objects are from Part and not from Assembly. You must create references extra for the Assembly:

Dim objRefPattern as Object
objRefPattern = objAssmDoc.CreateReference(Occ, objPattern)
Dim objRefHole as Object
objRefHole = objAssmDoc.CreateReference(Occ, HoleObj)
'and
objAsmPattern = objAssmDoc.AssemblyPatterns.Create("MyPattern", objOccArray, objRefPattern, objRefHole)

Regards
JR

SergeyUser is Offline
New Member
New Member
Posts:8

01/19/2010 7:29 AM  
You are absolutely right!
It's supposed from the definition of the method that the arguments must be reference-objects
The only problem that creating reference of feature has always failed (At least I couldn't do that)

Thanks
JRUser is Offline
Site Member
Site Member
Posts:57

01/20/2010 12:16 AM  
By me is all OK. Can you copy the coding hier?
SergeyUser is Offline
New Member
New Member
Posts:8

01/20/2010 3:57 AM  
Here is my test code

Dim Occ1 As SolidEdgeAssembly.Occurrence
Occ1 = objAsmDoc.Occurrences.Item(1)

Dim PartDoc As SolidEdgePart.PartDocument
PartDoc = Occ1.OccurrenceDocument

Dim Hole As SolidEdgePart.Hole
Hole = PartDoc.Models.Item(1).Holes.Item(1)
Dim AsmHole As Object
AsmHole = objAsmDoc.CreateReference(Occ1, Hole) 'exception E_FAIL

Dim Pattern As SolidEdgePart.Pattern
Pattern = PartDoc.Models.Item(1).Patterns.Item(1)
Dim AsmPattern As Object
AsmPattern = objAsmDoc.CreateReference(Occ1, Pattern) 'exception E_FAIL


JRUser is Offline
Site Member
Site Member
Posts:57

01/20/2010 6:38 AM  
I don't have any problems with your code!
SergeyUser is Offline
New Member
New Member
Posts:8

01/20/2010 8:19 AM  
It's really strange...
Probably it depends on the version of Solid Edge( My version is 20.00.00.96 )



JRUser is Offline
Site Member
Site Member
Posts:57

01/21/2010 12:09 AM  

My version is 20.00.15.05. Try again after instalation of Service Pack 15.

SergeyUser is Offline
New Member
New Member
Posts:8

01/23/2010 4:02 AM  

After installing SP15 Solid Edge all the time throws exception when I call the method

Dim Occs As SolidEdgeAssembly.Occurrences
Occs = objAsmDoc.Occurrences

I even don't know what to do... probably somehow initialize assembly or something else

You are not authorized to post a reply.
Forums > Solid Edge > Programming > How to create Assembly Patterns?



ActiveForums 3.7

  

 Users Online Minimize

Membership Membership:
Latest New User Latest: simoned
New Today New Today: 0
New Yesterday New Yesterday: 0
User Count Overall: 1767

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