hexagon logo

visual studio

I am struggling with two problems. Hopefully someone can help.
The following code will open pcdmis 2014.1, 32 bit, execute a program and close pcdmis.

1) How can I make pcdmis visible? Seems like "PCDApp.visible = True" doesn't do anything.
2) How can I make the application moveable when pcdmis is running? The application can be moved around the screen before and after pcdmis runs, but not during.

Dim PCDApp, PCDPartPrograms, PCDPartProgram
        PCDApp = CreateObject("PCDLRN.Application")
        PCDApp.visible = True
        PCDPartPrograms = PCDApp.PartPrograms
        PCDPartPrograms.Open("c:\test.PRG", "CMM1")
        PCDPartProgram = PCDApp.ActivePartProgram
        PCDPartProgram.Execute()
        PCDPartProgram.Close()
        PCDApp.Quit()
Parents
  • 1) I must be missing something really obvious to some of you, but PCDApp .visible, .restore of .maximize does nothing. In fact, the only selections that pop up when I type PCDApp. are Equals, GetHashCode, GetType, ReferenceEquals, or ToString.

    2) Looks like background worker is the way to go. Thanks!

    AndersI, any chance of posting some of the 'watchdog timer' code?


    It's because you've not defined what type of objects you're dealing with so vis studio intelisense can't let you knwo what properties and methods are available.

    Dim PCDApp, PCDPartPrograms, PCDPartProgram

    Try

    Add a reference to the pcdmis object library (Project > Add Ref > Com Tab select your version of pc-dmis)

    then

    dim PCDApp as pcdrln.application
    dim PCDPartPrograms as pcdlrn.partprograms
    dim PCDPartProgram as pcdlrn.partprogram

    Now you will have the methods & properties visible in the development environment
Reply
  • 1) I must be missing something really obvious to some of you, but PCDApp .visible, .restore of .maximize does nothing. In fact, the only selections that pop up when I type PCDApp. are Equals, GetHashCode, GetType, ReferenceEquals, or ToString.

    2) Looks like background worker is the way to go. Thanks!

    AndersI, any chance of posting some of the 'watchdog timer' code?


    It's because you've not defined what type of objects you're dealing with so vis studio intelisense can't let you knwo what properties and methods are available.

    Dim PCDApp, PCDPartPrograms, PCDPartProgram

    Try

    Add a reference to the pcdmis object library (Project > Add Ref > Com Tab select your version of pc-dmis)

    then

    dim PCDApp as pcdrln.application
    dim PCDPartPrograms as pcdlrn.partprograms
    dim PCDPartProgram as pcdlrn.partprogram

    Now you will have the methods & properties visible in the development environment
Children
No Data