Create dimension using arcpy

751
5
12-26-2021 02:13 PM
Khalid_Elejla
New Contributor II

How, can I create dimensions using arcpy

I was able to create polygons for example, but when it comes to dimensions I can't figure the right inputs to the class

Also, I found out that there is a class called arcpy. Dimension but it looks like it's empty compari g to polygon, polyline or point class

Tags (2)
0 Kudos
5 Replies
DanPatterson
MVP Esteemed Contributor

Geometry construction is found in the help topics

Geometry—ArcGIS Pro | Documentation

and there are links for Polygon, polyline etc.

What type of "dimension" are you referring to if it is no a spatial dimension? time?


... sort of retired...
Khalid_Elejla
New Contributor II

Thanks, Dan.

I am referring to the dimension feature class, I have a dimension layer and I want to add more dimensions(aligned dimension for example) to my map using arcpy

I use the following code to add polygons to my feature dataset but I couldn't do the same to the dimension layer using arcpy.Dimension class:

import arcpy

# Create a polygon geometry
array = arcpy.Array([arcpy.Point(0, 0),
                     arcpy.Point(0, 1000),
                     arcpy.Point(20, 900)
                     ])
polygon = arcpy.Polygon(array)

# Open an InsertCursor and insert the new geometry
cursor = arcpy.da.InsertCursor(r'C:\Users\kejla\Documents\ArcGIS\Projects\Gaza_Municapility\Default.gdb\test_polygon', ['SHAPE@'])
cursor.insertRow([polygon])

# Delete cursor object
del cursor

 

 

 

0 Kudos
DanPatterson
MVP Esteemed Contributor

A polygon needs 4 points to form a triangle, you need to add the first point to the end of the list to close the polygon


... sort of retired...
Khalid_Elejla
New Contributor II

I don't have problems in creating polygons, could you please guide me on how to do the same for the dimension layer, in other words how to add new dimension using arcpy

0 Kudos
DanPatterson
MVP Esteemed Contributor

There is no "arcpy" method of creating one from scratch.

Create a dimension feature class—ArcGIS Pro | Documentation

is all I can find


... sort of retired...
0 Kudos