Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Current »

Below is a demonstration of a simple API request in Python using the PyPCAD API:

  1. Import the Python API and assign an alias 'api' for future reference.

    import PyPCAD.api as api 
  2. For further use, create an Application Object.

    app = api.PyPCAD()
  3. Use AddText() to include text on the ModelSpace. Use Apoint() to pinpoint the location on the ModelSpace where the text will be inserted, specifying the desired height (e.g., 50).

    app.AddText("HELLO", api.Apoint(0, 0, 0), 50)
  4. Use ZoomExtents() to adjust the view to focus on the text within the ModelSpace.

    app.ZoomExtents()
  5. Save the Python file and run the program to observe the outcome within the ModelSpace.

  • No labels