Model a Component Creator 2 - Problem with the Python script

Hello,

I’m new to VC and I’m currently doing the courses and Tutorials to familiarize myself
I’m using VC 4.4 with a a Test license(premium), hopefully getting the actual license (professional) through my company next week.

While following the Video for “Model a Component Creator 2”, I keep getting the Error message

KeyError: None
for the line “creator = parts[comp.Product]” in the script although i can’t find any difference between my script and Williams script on screen

I tried running the downloaded file from the academy for this excercise
(“Model a Component Creator - Part 2 - Final.vcmx”)
but I still get the same Error message for the same line in the final script.

Is that a bug in version 4.4 (the version shown in the video is 4.1) or is there some setting to be changed, which is not mentioned in the video?

Thank you in advance

Kai

It’s caused by the fact that in 4.2 we introduced Process Modeling. With it new concept of “Product” was introduced. Now in the python API vcComponent.Product refers to this new Process Modeling product object and not component property called Product. So this tutorial is not functioning with 4.2 or newer and we should remove or change it.

Simple fix for the tutorial is to rename property to something else like “CreatedProduct” and change python script to use new naming. This way there’s no overlap with the PM Product.

-k

2 Likes

It works, thank you!

1 Like