Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Create the (Product+3DShape) couple Catia V6

Create the (Product+3DShape) couple Catia V6

Create the (Product+3DShape) couple Catia V6

Hello everyone,
I've been spending days trying to figure out how to create a Product then place in a 3DShape inside this product created, I tried this code below:


Sub CATMain ()
'-----create a product 

dim oNewService As PLMNewService2
set oNewService = CATIA.GetSessionService("PLMNewService2")
Dim oEditor As Editor 
oNewService.PLMCreate "VPMReference",oEditor

'------for the next line i want to add a 3DShape to this product I've created 

oNewService.PLMCreate "3DShape",oEditor  'the 3dshape is created alone in a new window  
End Sub 

as you can see in the code above, I have problem adding a 3DShape to the product ,

for more details , in V5 I can do that using the code below


Sub CATMain ()
dim documents1 As Documents 
set documents1=CATIA.Documents
dim productdocument1 As ProductDocument
set productdocument1=documents1.Add("Product")
dim products1 As Products
set products1=productdocument1.Products
dim product2 as product
set product2=products1.AddNewComponent("Part","")
End Sub 

Any hint is really appreciated!


RE: Create the (Product+3DShape) couple Catia V6

Can someone please help me out? bowleft

RE: Create the (Product+3DShape) couple Catia V6

thank you, I really appreciate your feedback , I've already checked this topic, its not what I'm looking for,

thank you for reply , could you please copy the thread presented in your COE Link, cuz I'm trying to access to the link but the login page keeps me of the thread, I registered but still not receiving the mail containing my password,

Thanks for your attention. I’m looking forward to your reply.


RE: Create the (Product+3DShape) couple Catia V6

@KABEL, please send email to coe@coe.org if you have a problem, they should be able to fix it.

Eric N.
indocti discant et ament meminisse periti

RE: Create the (Product+3DShape) couple Catia V6

Many thanks, you're too kind,I really appreciate your support,
First I'm using catia v6R2013, What I want to achieve is to create PDD (product) then insert (create inside) a 3DD (3DShape);
I found this way :
  • Retrieve the VPMReference object from the PDD after it has been created(root object of the editor : MyEditor3DShape1)
  • Retrieve the 3DShape object after it has been created (root object of the editor : MyEditor3DShape2)
  • Instantiate 3DD behind PDD (VPMRefPDD.Instances.Add 3DShape, VPMNewInst)
  • Close MyEditor3DShape2
here is my code :

CODE --> vba

Sub CATMain()

Dim My3DPartService As PLMNewService2
Set My3DPartService = CATIA.GetSessionService("PLMNewService2")
Dim MyEditor3DShape As Editor

My3DPartService.SetAttributeValue "V_CustoDiscipline", "PDD"
My3DPartService.PLMCreate "VPMReference", MyEditor3DShape               'the product now is created 

'   -   Retrieves the Product Service
    Dim MyProductService As PLMProductService
    Set MyProductService = CATIA.GetSessionService("PLMProductService")

'   -   Retrieves the Root Occurrence
    Dim MyVPMRootOcc As VPMRootOccurrence
    Set MyVPMRootOcc = MyProductService.RootOccurrence

'get vpmreference
Dim oVPMRefOnRoot As VPMReference
Set oVPMRefOnRoot = MyVPMRootOcc.ReferenceRootOccurrenceOf

' Create 3DPart
Dim oEditor3DShape As Editor
My3DPartService.SetAttributeValue "V_CustoDiscipline", "3DD"
My3DPartService.PLMCreate "3DShape", oEditor3DShape                 'the 3DShape is now created in a new window 

' Get Part from Editor
Dim oPart3D As Part
Set oPart3D = oEditor3DShape.ActiveObject

' Get VPMRepReference
Dim oVPMRepRef As VPMRepReference
Set oVPMRepRef = oPart3D.Parent

' Get VPMReference
Dim oVPMRef As VPMReference
Set oVPMRef = oVPMRepRef.Father          '<=== I got an error for this line  " the Father method of the object VPMRepReference failed 

'' Get window of initial 3dShape creation
Dim oMy3DPartWindowToClose As Window
Set oMy3DPartWindowToClose = CATIA.ActiveWindow

' Insert 3DPart Under root product
Dim oVPMInst As VPMInstance
oVPMRefOnRoot.Instances.Add oPart3D, oVPMInst   '<==== also for this line, type mismatch , the oPart3D need to be a VPMReference object , 

' Close 3DPart window

End Sub 

please help me out, I'm really stuck
thanks again,
thank you, I really appreciate your feedback, I'll try to get in touch with their support , thank you.

RE: Create the (Product+3DShape) couple Catia V6

You go up from the VPMRepRef to the VPMRef by passing by the VPMRepInstance

then maybe replace the oPart3D in the final line with the oVPMRef

Eric N.
indocti discant et ament meminisse periti

RE: Create the (Product+3DShape) couple Catia V6

could you please show me (the code) how to do that ?
thanks in advance

RE: Create the (Product+3DShape) couple Catia V6


Sorry I was wrong:


Dim oVPMRef As VPMReference
Set oVPMRef = oVPMRepRef.Father 

is good, it's just that the 3DShape editor is on a shape with no Part or product above, that's why its failing.

I try


My3DPartService.PLMCreate "3DPart", oEditor3DShape 

but I receive licensing error, I know that with proper license it worked because I use this and just copy/paste the part from the new editor to the product where I wanted the instance...

I guess you should talk to your VAR or DS about this...

Can you make a Product template then use it to create new part/shape in your product so you bypass the lic. limitation?

Eric N.
indocti discant et ament meminisse periti

RE: Create the (Product+3DShape) couple Catia V6

Thank you too much, I understand now,
in my case I don't receive any licencing error, the only thing I can't do is to create a 3DPart, I receive an error on the checking of the discipline client attribute SetAttributeValue "V_CustoDiscipline","PDD", I'm getting in touch with the DS about this issue,
thank you again, I really appreciate your help,

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Research Report - How Engineers are Using Remote Access
Remote access enables engineers to work from anywhere provided they have an internet connection. We surveyed our audience of engineers, designers and product managers to learn how they use remote access within their organizations. We wanted to know which industries have adopted remote access, which software they are using, and what features matter most. Download Now
eBook - Managing the Context of Product Complexity Using the Digital Twin
Keeping track of changes to complex products is difficult—think Aerospace & Defense equipment, new generations of commercial aircraft, and software-based automobiles. A new way to managing the digital context of the physical product is required and the answer is the Digital Twin. This ebook explores the opportunity available for Operations and Maintenance for the Digital Twin. Download Now
White Paper - Trends in Industrial Filtration
Substantial progress has been made in filtration technologies in recent years. New filter media materials, designs and processes have led to filters that are more efficient, reliable, compact and longer lasting. This white paper will discuss the various trends that are impacting operational responsibilities of MROs today and the resources that are available for staying up-to-date on the latest filtration solutions. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close