PartDocument prtDoc = (PartDocument)CATIA.ActiveDocument;
Part part1 = prtDoc.Part;
Can anyone explain what the above two lines of code will do?
PartDocument prtDoc = (PartDocument)CATIA.ActiveDocument;
Part part1 = prtDoc.Part;
Can anyone explain what the above two lines of code will do?
I assume that you are asking about type conversion.
You should get to know the concepts of implicit conversion
, explicit conversion
and strong typing
.
You can check which type is returned by given code, in your case CATIA.ActiveDocument;
and with knowledge from above, you will know
when to typecast and when not to do
You can learn more about C# typing from official documentation here