0

I am trying to add text field to an opened drawing in CatiaV5 through the API. Though I am able to start Catia, open the drawing I am not able to refer to the DrawingDocument, DrawingText classes even though added references DRAFTINGITF.tlb file. Is there anything else I need to do. I have created the same functionality previously which was working but now after rebuild that also doesnt work.enter image description here enter image description here

thanks in advance.

sina123
  • 189
  • 1
  • 1
  • 13

1 Answers1

0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DRAFTINGITF;             // DID YOU REMEMBER THIS?
using System.Diagnostics;
namespace ConsoleApplication1
{
    class Program
    {
    static void Main(string[] args)
        {

            INFITF.Application oCATIA =  (INFITF.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("CATIA.Application");
            var oDoc = (DrawingDocument) oCATIA.ActiveDocument;
            Debug.Print(oDoc.FullName);
        }

    }
}
C R Johnson
  • 964
  • 1
  • 5
  • 12