Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I identify the name of a newly created surface from CopyObject?

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
224 Views, 3 Replies

How do I identify the name of a newly created surface from CopyObject?

I just created an adaptible surface in a part using copy object however the surface has 2 names Srf3 and Surface2.  For whatever reason the program does not recognize "Surface2." as the name.  If I create a new surface using copy object I'm lost as to the new name and which is correct to use when calling the split command.  Can anyone help?

 

Option Explicit
Dim oPartDoc As PartDocument
Dim oCompDef As PartComponentDefinition
Dim oSplit As SplitFeature

Public Sub SplitAllFaces()
    
    On Error GoTo err_SplitAllSurfaces
    
    Set oPartDoc = ThisApplication.ActiveDocument
    Set oCompDef = oPartDoc.ComponentDefinition
    
    Dim oWorkSurfaces As WorkSurfaces
    Dim oWorkSurf As WorkSurface
    Dim oWorkplane As WorkPlane
    Dim oSurfBodies As SurfaceBodies
    Dim oSurfBody As SurfaceBody
    Dim oSurfBodyDef As SurfaceBodyDefinition

    Set oWorkSurfaces = oPartDoc.ComponentDefinition.WorkSurfaces
    Set oWorkSurf = oWorkSurfaces.Item("Surface2")
    Set oSurfBodies = oCompDef.SurfaceBodies

'    MsgBox "Please wait while the Splits are being performed....."
    For Each oSurfBody In oSurfBodies
        'Take the remaining workplanes and slice and dice
        Set oSplit = oCompDef.Features.SplitFeatures.SplitFaces(oWorkSurf, _
                          True, oSurfBody)

    Next oSurfBody

 

3 REPLIES 3
Message 2 of 4
rossano_praderi
in reply to: Anonymous

May you post the part document?


--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
Message 3 of 4
Anonymous
in reply to: rossano_praderi

Sorry, not allowed. 

 

To give a background I'm trying to take an assy w/ a crane path and carve out the interference of an item along the assy.  So I'm taking, for example, a car and adding the crane crossection pathway with copy object to the car part.  Then I need to split all the solids that make up the body using the surface representing the outer edges of the crane traveling down the assembly line.  I can then highlight the new solids red and take measurements. 

 

However I'm trying to have the copy object command function automatically such that I need only press a button and I have a new car assy complete w/ the interference cutouts.  If I don't have a way of identifying the surface that was created using copy object I have to update the code manually for each subAssy part.

 

So for a simple example I have the Body, Chassis, and Interior each as a multibodied part.  I need to copy the crane path surface to each part.  Then perform splits for each solid of each multibodied part.  

 

The problem being I don't know what the surface name is when I copy it into each part.   

Message 4 of 4
rossano_praderi
in reply to: Anonymous

Thank you for your kindly and clear explanation, I think is better to talk with a computer programmer for solve your issues.


What I miss is the time.


Then, first of all I'm sorry to waste your time, I believe you will find a qualified person with more time.

 

Bregs

Rossano Praderi



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report