Results 1 to 4 of 4

Thread: CP316-5: Creating Parametric and Geometric Constraints Using the AutoCAD® .NET API

  1. #1
    Autodesk, Inc. Autodesk University's Avatar
    Join Date
    2012-11
    Posts
    3,030

    Default CP316-5: Creating Parametric and Geometric Constraints Using the AutoCAD® .NET API

    Session: CP316-5

    Title: Creating Parametric and Geometric Constraints Using the AutoCAD® .NET API

    Instructor: Stephen Preston

    Course Description: In AutoCAD 2010, we introduced the Parametric Drawing feature that allows geometric and dimensional constraints to be added to AutoCAD drawing elements. AutoCAD 2011 introduces a .NET API to allow you to add, edit, and query these constraints from your add-in applications. In this class, we will explain the underlying architecture of this feature and demonstrate the API using some simple examples.

  2. #2
    Woo! Hoo! my 1st post
    Join Date
    2017-01
    Posts
    1

    Default Re: CP316-5: Creating Parametric and Geometric Constraints Using the AutoCAD® .NET API

    I've found this course do be very useful, it put me on the right track regarding Geometric Constraints. However, I have a couple of problems which it doesn't answer.

    The application I'm writing draws a network of lines, circles and blocks based on its input data. I use coincident constraints to keep some of the entities joined together. This means that the user can change the layout of the drawing as he wishes but the entities stay together so he can't change their meaning.

    Unfortunately, I've found that some of the constraints I'm trying to apply do not work, even though a similar constraint can be applied via the user interface. In particular:

    1. Circle Centre
    A coincident constraint between a line an a circle can only be made against the circle's edge. Whereas the user interface constrains between the centre of the circle and the line.

    I noticed that calling subEntityIdPe.GetAllSubentities(circle, SubentityType.Vertex) returns a single SubentityId. I've tried constraining the line against this but constraintGroup.AddGeometricalConstraint(GeometricalConstraint.ConstraintType.Coincident, paths) fails with an eInvalidInput exception. NB: I'm not sure what the vertex of a circle is to AutoCAD.

    How can I create a coincident constraint against the centre of a circle from .NET?

    2. Constraining Elements within a Block Reference.

    I've found that I can create a coincident constraint between a block reference and the end of a line. This time using the Vertex subentity object does the trick. Unfortunately, this finds the centre of the block, I would really like to find the edge of a circle that is inside the block. Navigating through the objects attached to the block reference, the best I can find is the circle attached to the original block, not the block reference.

    Is it possible to find the "real" entities within a block reference so that I can constrain them? Again, I am using .NET.

    I wonder whether the features I need are not available through the .NET API.



    If you have can share any insights on this it would be much appreciated..

  3. #3
    Mod / Salary / SM Wanderer's Avatar
    Join Date
    2001-12
    Location
    St. Louis
    Posts
    5,406

    Default Re: CP316-5: Creating Parametric and Geometric Constraints Using the AutoCAD® .NET API

    Quote Originally Posted by sms741514 View Post
    I've found this course do be very useful, it put me on the right track regarding Geometric Constraints. However, I have a couple of problems which it doesn't answer.

    The application I'm writing draws a network of lines, circles and blocks based on its input data. I use coincident constraints to keep some of the entities joined together. This means that the user can change the layout of the drawing as he wishes but the entities stay together so he can't change their meaning.

    Unfortunately, I've found that some of the constraints I'm trying to apply do not work, even though a similar constraint can be applied via the user interface. In particular:

    1. Circle Centre
    A coincident constraint between a line an a circle can only be made against the circle's edge. Whereas the user interface constrains between the centre of the circle and the line.

    I noticed that calling subEntityIdPe.GetAllSubentities(circle, SubentityType.Vertex) returns a single SubentityId. I've tried constraining the line against this but constraintGroup.AddGeometricalConstraint(GeometricalConstraint.ConstraintType.Coincident, paths) fails with an eInvalidInput exception. NB: I'm not sure what the vertex of a circle is to AutoCAD.

    How can I create a coincident constraint against the centre of a circle from .NET?

    2. Constraining Elements within a Block Reference.

    I've found that I can create a coincident constraint between a block reference and the end of a line. This time using the Vertex subentity object does the trick. Unfortunately, this finds the centre of the block, I would really like to find the edge of a circle that is inside the block. Navigating through the objects attached to the block reference, the best I can find is the circle attached to the original block, not the block reference.

    Is it possible to find the "real" entities within a block reference so that I can constrain them? Again, I am using .NET.

    I wonder whether the features I need are not available through the .NET API.



    If you have can share any insights on this it would be much appreciated..
    You'll probably get a better response by posting a question in the programming section. http://forums.augi.com/forumdisplay.php?215-Dot-Net-API
    (I'd recommend linking back to this thread for their reference.)

    Cheers!
    Melanie Stone
    @MistresDorkness

    Archibus, FMS/FMInteract and AutoCAD Expert (I use BricsCAD, Revit, Tandem, and Planon, too)
    Technical Editor
    not all those who wander are lost

  4. #4

    Default Re: CP316-5: Creating Parametric and Geometric Constraints Using the AutoCAD® .NET API

    Hi. I am a new member to this forum. It is so interesting here guys.

Similar Threads

  1. 2011: Using Parametric Constraints for Constant SF
    By joeroof in forum ACA General
    Replies: 0
    Last Post: 2012-02-10, 07:04 PM
  2. Parametric Constraints
    By erico2_99197853 in forum ACA General
    Replies: 1
    Last Post: 2011-05-05, 12:29 AM
  3. Geometric Constraints
    By revit.wishlist1942 in forum Revit Structure - Wish List
    Replies: 0
    Last Post: 2010-10-14, 09:24 PM
  4. Geometric constraints stretch autocad 2010
    By precast100 in forum AutoCAD General
    Replies: 0
    Last Post: 2009-07-31, 01:58 AM
  5. AutoCAD 2010-Using geometric constraints on a block
    By Brannonp in forum AutoCAD General
    Replies: 1
    Last Post: 2009-04-19, 09:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •