Welcome, Guest. Please login or register.
Did you miss your activation email?
February 08, 2012, 01:48:58 AM
Home Help Login Register
News: Any Problems or Experience with Industrial Robots ?
Register and place your Question / Answer to worldwide Robotexperts right here !

+  Robotforum | Support for Robotprogrammer and Users
|-+  Simulation Systems
| |-+  Delmia / Igrip
| | |-+  Macro in Delmia
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Macro in Delmia  (Read 3635 times)
Mel
Newbie
*
Offline Offline

Posts: 5


« on: June 29, 2010, 10:42:37 PM »

Hi ,

I am programming some VBA macros in Delmia with interface to make easier the life of the user.

I know there is the option to "Start Recording" macro, then I can make some operation in delmia and see the code generated by these operations. But when I click, by example, on "Restore initial state". There is no code generate.

Is someone know where I can find a list of the command in VBA to call some delmia's function in my macro.

Thanks, 
Logged
simspec
Full Member
***
Offline Offline

Posts: 132


« Reply #1 on: June 30, 2010, 10:27:39 PM »

Are you running the standalone or the catia version?

- i dont know either but hopefully someone does
Logged
Mel
Newbie
*
Offline Offline

Posts: 5


« Reply #2 on: July 05, 2010, 09:42:16 PM »

I'm running the Stand Alone Version...
Logged
simspec
Full Member
***
Offline Offline

Posts: 132


« Reply #3 on: August 19, 2010, 08:21:47 AM »

have you found anything on this yet?
Logged
axelb
Newbie
*
Offline Offline

Posts: 2


« Reply #4 on: November 02, 2010, 06:16:18 PM »

Hi,

Some functions of Delmia doesn't work with the "recording macro" ability.

Maybe you can find the function/keyword in the documentation -> Delmia infrastructure -> automation

Best regards
Axel

Logged
simspec
Full Member
***
Offline Offline

Posts: 132


« Reply #5 on: November 02, 2010, 11:29:43 PM »

try this in vba:

 CATIA.StartCommand ("{commandname]") 


replace [commandname] with a valid command, it starts functions that are not recordable, it might work for delmia,

to find valid command names hover over the the button of the function and use the command name that appears next to the text window in the bottom right hand corner of the catia window.

you might need to replace CATIA.StartCommand with DELMIA.StartCommand
Logged
Mel
Newbie
*
Offline Offline

Posts: 5


« Reply #6 on: December 03, 2010, 04:59:13 PM »

Hi all!

In case that I can help someone else  the folowing code replace the RestoreInitialState function in VB:

DELMIA.StartWorkbench ("DNBAsy")
   
    'Get the document
    Dim processDocument1 As ProcessDocument
    Set processDocument1 = DELMIA.ActiveDocument
       
    'Get the process document
    Dim ProcessDoc As PPRDocument
    Set ProcessDoc = processDocument1.PPRDocument

   
    Dim prodList As PPRProducts
    Set prodList = ProcessDoc.Resources
           
    'Variable declaration
    Dim count
    Dim iSimInitState As SimulationInitState
    Dim iMask As DNBSimInitStateAttr
    Dim RootProduct As Product
   
    count = prodList.count
   
    If (count > 0) Then
    Set RootProduct = prodList.Item(1)
    End If
   
    'Variable Initialisation
    iMask = DNBAllInitStateAttr
    Set iSimInitState = RootProduct.GetTechnologicalObject("SimulationInitState")
         
    'Save all attributes of selected product List
    iSimInitState.RestoreInitialState iMask

Best Regards

Mel
Logged
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!