Reference dims in assembly file

Reference dims in assembly file

tmathieson
Advocate Advocate
552 Views
2 Replies
Message 1 of 3

Reference dims in assembly file

tmathieson
Advocate
Advocate

Hello to All,

 

i am trying to code a rule that will add a couple reference dimensions in an assembly module so that the user can have a reference on the screen to some critical dims in the assembly.  this can be done in the assembly module (see attached), but would like to code it .  i have done some coding for dims on Drawings, but not for in the assembly module. have searched thru the forms and the API samples, but have not found any examples. 

 

i assume this would be similar to adding a dim in a drawing, but no need for Transient Geometry? do you still need to create center marks and 2D points?

 

thanks for any help or insight into this!

0 Likes
553 Views
2 Replies
Replies (2)
Message 2 of 3

WCrihfield
Mentor
Mentor

Hi @tmathieson.  This is a bit more complicated than adding dimensions to a drawing, because it is being created within the 3D space of the assembly, instead of on a 2D sheet, so there are some additional steps, such as defining the annotation plane and its axis orientation.  I can point you in the right direction(s) to get you started, but I would need a lot more than that image to be able to write a code that would work for you.  Since you have used code to add dimensions to a drawing, you likely know that you need fairly intimate knowledge of the models, geometry, references, standards, & styles you are working with, in order to make all that happen to your exact liking.

You can use the following path(s) to get to those model annotations, and the methods used to create them.  There are online documentation for most of this stuff now, but I don't recall if all the links/URL's are working properly yet.

oMAs = AssemblyDocument.ComponentDefinition.ModelAnnotations

From there, the first thing you would likely have to do is use one of the 2 methods for creating an AnnotationPlaneDefinition.  This is where your model dimension will reside on within the model space.  Then you would need to step down into ModelDimensions (as apposed to other types of available annotations), then down to the more specific LinearModelDimensions, then use its two methods (one for creating a 'LinearModelDimensionDefinition', the other uses the 'definition' to create the LinearModelDimension).  You can read more about all of that in the online help area, under Programming Interface > Inventor API Reference Manual > Objects > (the object Type name).

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 3

tmathieson
Advocate
Advocate

Hi @WCrihfield , thanks for the info.  guess i will just have them add it manually for now :^).  i have the dims values i want to show viewable in a form, but wanted to have them more 'visible' to the user.

 

and thanks for the offer to help with the code!  i will delve into it later this week, review the links/info you suggest, and see how i make out starting to get a handle (kind of) on objects and object sets, and browser nodes.... and more.

a good chance (more than good)  i will be back looking for more help/direction.

 

thanks again, have a good one!!

0 Likes