Author Topic: Item.Update() removes info on dividing oversized-parts  (Read 1633 times)

0 Members and 1 Guest are viewing this topic.

Offline jaysomlamTopic starter

  • Senior Member
  • ****
  • Posts: 453
  • Country: us
  • Gender: Male
Item.Update() removes info on dividing oversized-parts
« on: Nov 06, 2019, 20:05:54 PM »
I find that using Item.Update() on a duct results with losing the info about how the oversized parts of the duct should be sub-divided.  Let say a CAMduct user has a square-bend that is quite large.  Its heel-part is oversized.  The CAMduct user chooses to sub-divide the long oversized heel-part into two smaller parts.  For some reason my program needs to change one of the connector of that square-bend.  After it has changed the connector, it uses Item.Update() command to refresh the square-bend (admittedly the program really doesn't need to do this).  Unfortunately, right after using Item.Update() command, the "dividing the heel-parts into two" info becomes lost.  Seem like Item.Update() command removes the divide-oversized-parts info from the square-bend.  This causes the heel-part to be oversized and cannot be nested.

The obvious solution is not to use Item.Update() command.  And this indeed is what I will do because I don't think we need to update a duct after I have changed the connector of the duct.  But I want to know more about this before I remove all the Item.Update() commands from my program.

My questions are:

1.  According to the Help file in SDK, Item.Update() updates "the item to reflect any changes in calculated values such as Area and Weight".  What are the other "calculated values" other than Area and Weight?

2.  Is there a way to check if the oversized part in a duct has been sub-divided into smaller parts?  I figure that if its oversized part has not been sub-divided, there will be no harm using Item.Update() on the duct.  But I cannot find any Item properties that can tell me if the item has any oversized part, let alone if the oversized part has been sub-divided.

Please let me know.  Thanks.

Jaysom

Offline Darren Young

  • Premier Member
  • *****
  • Posts: 2081
  • Country: us
  • Gender: Male
    • BIM There Done That.
Re: Item.Update() removes info on dividing oversized-parts
« Reply #1 on: Nov 06, 2019, 21:16:27 PM »
Order of operations is important.

Changing a connector, seam, etc all force the item to redevelop which is why you're loosing the oversize options.

The redevelopment is important to properly calculate the shape to cut. If you change a connector for a S&D to TDC or Flange Out, it changes the amount of material that's needed. That's why the redevelopment is required.

Item.Update() recalculates that info.

So, any changes you edit to a fitting should be done before anything that would alter the default development pattern like oversize options, editing notches, adding pierce points, etc.

Offline Don

  • Premier Member
  • *****
  • Posts: 1183
  • Country: gb
  • Gender: Male
    • Pure Fabs
Re: Item.Update() removes info on dividing oversized-parts
« Reply #2 on: Nov 07, 2019, 08:37:42 AM »
Darren is spot on with his post. The very last thing that should be done with an item is editing the developments, then straight to nesting. We've all been guilty in the past of inadvertently going back into an item and losing what we thought we had previously done.  :)
“There's someone in my head, but it's not me.”
― Pink Floyd

Offline jaysomlamTopic starter

  • Senior Member
  • ****
  • Posts: 453
  • Country: us
  • Gender: Male
Re: Item.Update() removes info on dividing oversized-parts
« Reply #3 on: Nov 07, 2019, 12:38:48 PM »
Thanks for letting me know the correct sequence of operation.  Seem like the use of Item.Update() is not the problem.  The problem is doing the development (sub-dividing the oversized part into multiple smaller parts) before running the program that may change the connectors/seams -- this should be done the other way around.

OK, I got it.
Jaysom

Offline Darren Young

  • Premier Member
  • *****
  • Posts: 2081
  • Country: us
  • Gender: Male
    • BIM There Done That.
Re: Item.Update() removes info on dividing oversized-parts
« Reply #4 on: Nov 07, 2019, 15:19:25 PM »
Yea...they don't really put info like that in the book.....if there was a book.

There once was a book but it's no longer available. Even if it was, I'm fairly certain it's not in there either.

Offline Don

  • Premier Member
  • *****
  • Posts: 1183
  • Country: gb
  • Gender: Male
    • Pure Fabs
Re: Item.Update() removes info on dividing oversized-parts
« Reply #5 on: Nov 07, 2019, 15:51:34 PM »
Yea...they don't really put info like that in the book.....if there was a book.

There once was a book but it's no longer available. Even if it was, I'm fairly certain it's not in there either.

You can only learn this at the University of Life!  ;)
“There's someone in my head, but it's not me.”
― Pink Floyd

Offline Darren Young

  • Premier Member
  • *****
  • Posts: 2081
  • Country: us
  • Gender: Male
    • BIM There Done That.
Re: Item.Update() removes info on dividing oversized-parts
« Reply #6 on: Nov 07, 2019, 16:00:38 PM »
You can only learn this at the University of Life!  ;)

Life...It'll kill you.