Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a new PDD and Insert a 3DD Catia V6 VBA 2

Status
Not open for further replies.

KABEL

Automotive
Dec 10, 2018
29
MA
Hello everyone,

I've been spending days trying to solve this issue. I'm trying to write a VBA script that can create a new document with a new PDD and insert a new 3DD in V6, and I'm not able to find a solution. In V5, you could use something like:
Code:
Sub CATMain()
'===create a part document
Dim documents1 As Documents
Set documents1 = CATIA.Documents

Dim partDocument1 As PartDocument
Set partDocument1 = documents1.Add("Part")
End Sub

But it CATIA v6, this is no longer valid (!). Does anyone of you know how to adapt the code above so it could work in V6?

Any hint is really appreciated!

Thanks
 
Replies continue below

Recommended for you

Hello,
First, thank you all for your responses,I really appreciate it;
LWolf:
thank you I've already checked this one but its not working for me and its not what I'm looking for. I'm working on a project that needs to create automatically 3DPart, everything runs very well except for creating(3DPart ,"part") new document with a PDD inside and insert a 3DD .

fredo
thank you, I'm using the V6R2013x, for the recording is not working, I've tried this but when I opened the macro is empty; then I tried this code :

Code:
Sub CATMain()

Dim oNewService As PLMNewService
set oNewService = CATIA.GetSessionService("PLMNewService")

Dim oEditor As Editor 
[COLOR=#EDD400]oNewService.PLMCreate "3DShape",oEditor[/color]

End Sub

but I got this error (for the yellow line ): " verification of client discipline attributes failed: you must choose a Client Discipline different that '---' from the list." ,

Any help is highly appreciated,
Regards,
 
ferdo:

Thank you again, for the customization,I didn't quite understand what you meant. could you illustrate what do you mean by customization ?
for the code above its the same as in the documentation, but I still get the same error.

I found a response on Community of experts of dassault systems solutions Forum
: that I may need an extra licence : VMX license for V6R13X or E70 licence for V6R2015X, what do you think ?

Thank you in advance,
Sincerely,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top