AutoCAD Startup LISP Routine: CCONSTRAINTFORM

StartupLISPRoutine-CCONSTRAINTFORM.jpg

When working with Parametric controls within AutoCAD, dynamic constraints are created, by default, when you use the DIMCONSTRAINT command.

kristinayoungblut_0-1658493924021.png

Usually, this isn't an issue for most Parametric Development as we use these dimensions to control and constrain our models parametrically. For those of us that also want to Annotationally Dimension a model, CCONSTRAINTFORM allows us to change the default setting to suit our development needs.

 

Dynamic Constraint Mode, these dimensions are hidden when reopening a file or selecting "Hide All" in the Dimensions Tool Panel.

kristinayoungblut_2-1658502787536.png

 

Annotational Constraints act similar to regular Dimensions but allow you to control the constraint and the component parametrically as if it was a Dynamic Constraint; visually, it looks like a typical dimension.

Annotative Constraint

kristinayoungblut_1-1658502550519.png

Dynamic Constraint

kristinayoungblut_0-1658502539498.png

 

Including CCONSTRAINTFORM in your Startup routine ensures you never miss a dimension, that your content is appropriately labeled, and that all of this is still parametrically constrained. 

 

NOTE: Annotated Dimensions do not always stay constrained to the object (as it is being parametrized) and can cause issues and errors for Users of that content. Utilizing the constraint-based dimensions also reduces the need for both types of dimensions.

kristinayoungblut_3-1658503511510.png

 

1. Starting a LISP Routine from scratch

If you are creating this file from scratch, it will require the syntax to match the following:

(DEFUN S::STARTUP ()
(COMMAND "<variable name>" "<setting>")

;(COMMAND "<variable name>" "<setting>") - If you have more than one command

;(COMMAND "<variable name>" "<setting>") - and so on... and so on...
)

The user-defined functions will vary depending on the action and routine you want to write and run. We are creating a Startup Function.

Now to apply our function and requirements. 1 stands for "Annotational Constraint" this will force the file to default to Annotational Constraint instead of Dynamic Constraint.

(DEFUN S::STARTUP ()
(COMMAND "CCONSTRAINTFORM" "1")
)

 

View this resource from Autodesk Learning Blog to load LISP into your system.

 

2. Already have a LISP 

If you already have a startup LISP routine that you use, add this to a new row:

(COMMAND "CCONSTRAINTFORM" "1")

 

To customize Startup routines, I suggest making a LISP file specific to your needs. I find this helpful in collaborating with teams, setting up a new computer, or sharing knowledge with others.

 

Helpful Links:

AutoCAD Support and Learning - CCONSTRAINTFORM (System Variable)

AutoCAD Support and Learning - How to automatically load LISP routines in AutoCAD

S::STARTUP Function: Postinitialization Execution

2 Comments