SolidEdge Problem : BooleanFeature.add with VB6


 
Post new topic Reply to topic
   ArchitectureWeek DesignCommunity Forum Index » Open 3D CAD Discussion
View previous topic :: View next topic  
Author Message
xfaure1



Joined: 03 Jul 2008
Posts: 1

PostPosted: Thu Jul 03, 2008 4:08 am    Post subject: SolidEdge Problem : BooleanFeature.add with VB6 Reply with quoteFind all posts by xfaure1

Hello everybody

I try to do a substract between two solids.
I created a DocumentPart.
I copy two parts on this new document.
the first created a model in objDoc.Models.
the second add a Item in objDoc.Constructions.CopyConstructions
and add a item in objDoc.Models(1).Features

So, I process this function :
objDoc.Models.Item(1).BooleanFeatures.Add with goods parameters but it fails!

I don't understand. Does somebody can help me?

thanks a lot

Xavier FAURE

Code:

Module ModuleVolume

Sub Main()
'Declare the program variables.
Dim objApp As Object = Nothing
Dim objDocs As Object = Nothing

'Turn on error handling.
On Error Resume Next

'Connect to a running instance of Solid Edge.
objApp = GetObject(, "SolidEdge.Application")
If objApp Is Nothing Then
'Error message
MsgBox("The Application is closed. The program is going to open it.")
'Start Solid Edge.
objApp = CreateObject("SolidEdge.Application")
End If

'Turn off error handling.
On Error GoTo 0

'Make the application window visible.
objApp.Visible = True

'Access the Documents collection.
objDocs = objApp.Documents

Dim objDoc As Object

'Find out if any documents are open.
If objDocs.Count = 0 Then
'Add an Part document.
objDoc = objDocs.Add("SolidEdge.PartDocument")
Else
'Access the currently open document.
'MsgBox("Connection of part which is opened")
objDoc = objApp.ActiveDocument
End If

Dim objModel As SolidEdgePart.Model = objDoc.Models(1)
MsgBox("Number of shells ( in Models(1).Body ) : " + objModel.Body.Shells.Count.ToString)
MsgBox("Number of features : " + objModel.Features.Count.ToString)
Dim objConstructions As SolidEdgePart.Constructions = objDoc.Constructions
MsgBox("Number of constuctions : " + objConstructions.Count.ToString)
Dim objCopyConstructions As SolidEdgePart.CopyConstructions = objConstructions.CopyConstructions
MsgBox("Number of CopyConstructions : " + objCopyConstructions.Count.ToString)

Dim objBooleanFeatures As SolidEdgePart.BooleanFeatures = objDoc.Models.Item(1).BooleanFeatures

'The number of solid to do the boolean opertation
Dim NumberOfTools As Integer = 1
'A array which contains these solids
Dim Tools() As Object = {objConstructions.Item(1).Body}
'A member of the BooleanFeatureConstants constant set that specifies the type of Boolean operation to perform.
Dim Operation As SolidEdgePart.BooleanFeatureConstants = SolidEdgePart.BooleanFeatureConstants.seBooleanSubtract

MsgBox("Clic on Ok to process the function")

'Process the boolean fonction
objBooleanFeatures.Add(NumberOfTools, Tools, Operation)

MsgBox("It's Ok")

End Sub

End Module


AsmT.zip
 Description:

Download
 Filesize:  36.07 KB
 Downloaded:  95 Time(s)
AsmT.zip
 Description:

Download
 Filesize:  36.07 KB
 Downloaded:  90 Time(s)
Back to top
View user's profileSend private message    share:   blogger     del.icio.us     digg     slashdot    
Display posts from previous:   
Post new topic Reply to topic
   ArchitectureWeek DesignCommunity Forum Index » Open 3D CAD Discussion Page 1 of 1

 




Latest Posts   ·   ArchWeek Jobs Board   ·   Classifieds   ·   User Galleries   ·   Scrapbook   ·   Open 3D Gallery
 Architecture Search   by name of Building, Architect, or Place:  
Buildings     Architects     Types & Styles     Places     Models     GB Image Index     ArchWeek Library
Professional Directory   Web Directory   Competitions   Conferences   Events & Exhibits     Products     Media Kit
DesignCommunity   ·   ArchWeek   ·   Great Buildings   ·   Archiplanet   ·   Books   ·   Blogs   ·   Free 3D   ·   Search
© 2004-2008 Artifice, Inc. · Powered by phpBB © 2001, 2002 phpBB Group
Thème myApple v2.0.1 créé par myTemplate