Author Topic: Cannot Change Cut-Type of a Screen Using API  (Read 201 times)

0 Members and 1 Guest are viewing this topic.

Offline jaysomlamTopic starter

  • Senior Member
  • ****
  • Posts: 259
  • Country: us
  • Gender: Male
Cannot Change Cut-Type of a Screen Using API
« on: Sep 20, 2019, 08:20:13 PM »
I am trying to use API program to change the Item.CutType of our screens (CID#12). By default, the CutType of a screen is Machine-Cut. I am trying to change the CutType to "Sheared" if the frame of the screen is large (because I cannot get CAMduct to nest reasonable size parts inside the big blank hole of the large frame). I can manually change the CutType of a screen through CADmep Properties window, and the change sticks after I save and re-open the drawing. But somehow I cannot change the CutType if I try to do this through API. The compiler will show this error message:

Property or indexer 'Item.CutType' cannot be assigned to -- it it read only

This can happen to straight duct also. Luckily for straight duct, I can use the option "Override Cut Type" to work around this. But screen doesn't have that option.

I can workaround this by not sending the large screens to CAMduct. This prevents them from being nested. But I just don't like to leave loose end in the drawings and in my program. I am hoping that there is a cleaner solution.

I try to use CAMduct to dynamically assign the default Cut-Type of the screen based on the size of the screen.  Unfortunately Cut-Type is not one of the available field in the default properties window of the screen.

Please let me know if there is a way to fix this problem. Thanks.

Jaysom

Offline DotNet

  • Full Member
  • ***
  • Posts: 160
  • Country: us
  • Gender: Male
    • MICLOGIC
Re: Cannot Change Cut-Type of a Screen Using API
« Reply #1 on: Sep 20, 2019, 08:30:40 PM »
Hi Jay. The FabricationAPI.CHM file is your friend here. If you look up the Item.CutType property you will see that is read only however your search will also reveal the ChangeCutType method.

Code: [Select]
ItemOperationResult result = Item.ChangeCutType(cutType);

There is a better code example in the CHM file, and remarks to help you along the way.

Offline jaysomlamTopic starter

  • Senior Member
  • ****
  • Posts: 259
  • Country: us
  • Gender: Male
Re: Cannot Change Cut-Type of a Screen Using API
« Reply #2 on: Sep 23, 2019, 08:11:17 PM »
Thanks for letting me know this function.  It works great! 

Jaysam