Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a new table in AutoCAD.
AutoCAD
table = acad.model.AddTable(Point3d(0, 0, 0), [1], 3, 2, 2)
Attempts:
3 left
💡 Hint
Common Mistakes
Using the number of columns instead of rows.
Using zero or negative numbers.
✗ Incorrect
The number of rows is set to 4 to create a table with 4 rows.
2fill in blank
mediumComplete the code to set the text height of the table.
AutoCAD
table.TextHeight = [1]Attempts:
3 left
💡 Hint
Common Mistakes
Setting text height too large causing overlap.
Using zero or negative values.
✗ Incorrect
Text height of 0.5 is a common readable size for table text in AutoCAD.
3fill in blank
hardFix the error in the code to add a row to the table.
AutoCAD
table.[1]()Attempts:
3 left
💡 Hint
Common Mistakes
Using AddColumn instead of AddRow.
Using InsertRow which is not a valid method.
✗ Incorrect
The correct method to add a row is AddRow().
4fill in blank
hardFill both blanks to set the text in the first cell of the table.
AutoCAD
table.SetText([1], [2], "Header")
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 for the first row or column index.
Confusing row and column order.
✗ Incorrect
Row and column indexes start at 0, so the first cell is (0, 0).
5fill in blank
hardFill all three blanks to create a table with 3 rows, 4 columns, and set the row height to 1.5.
AutoCAD
table = acad.model.AddTable(Point3d(0, 0, 0), [1], [2], 2, 2) table.RowHeight = [3]
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping rows and columns numbers.
Setting row height too small or too large.
✗ Incorrect
The table has 3 rows and 4 columns, and the row height is set to 1.5 for good spacing.
