Create Geometry with Python

Hello everyone,

I’d like to try my hand at Python for the first time and would like to create a geometry using a Python script, but I’m not quite sure where to start:

Here are the steps I’ve taken so far:

  1. I selected a standard block component from the E-Catalog
  2. I created a Python script in the Modeling tab
  3. Created a simple Python script with the help of AI

Unfortunately, I’m only getting error messages—is it even possible to create geometries this way?

Thanks in advance :slight_smile:

Are you trying to create a geometry or a property or modify an existing property?

It looks like your AI tool invented some methods, I’ve never heard of “hasProperty” :face_with_raised_eyebrow:

I would suggest to have a look at the Help file, it has some Examples and a “How to” section.

Here is How to use Properties or here an Example on how to create properties or How to create a Block feature

Try with this: Visual Studio CoPilot AI Helper released for Python API