Is it possible to automatically arrange Chain dimensions

Is it possible to automatically arrange Chain dimensions

robertast
Collaborator Collaborator
4,232 Views
19 Replies
Message 1 of 20

Is it possible to automatically arrange Chain dimensions

robertast
Collaborator
Collaborator

If I run this iLogic program it aligns them incorrectly. If I use a Chain Set, that dimension does not respond to alignment

dim.jpg

4,233 Views
19 Replies
Replies (19)
Message 2 of 20

robertast
Collaborator
Collaborator

@MjDeck  ; @adam.nagy  ; @chandra.shekar.g 

Could you clarify to make this possible? Do I need to go to the Ideas forum with this request

0 Likes
Message 3 of 20

robertast
Collaborator
Collaborator

If only one such dimension is used, the rule works well. But if the second occurs, everything breaks down 😕

Message 4 of 20

MjDeck
Autodesk
Autodesk

If you have a chain dimension set, please try the ChainDimensionSet.Arrange method. That should give better results. 

The help says that the general DrawingDimensions.Arrange method doesn't work for dimensions that are members of chain dimension sets. (However you should be able to arrange the whole set if you provide the set object itself as an argument to that function.)


Mike Deck
Software Developer
Autodesk, Inc.

Message 5 of 20

robertast
Collaborator
Collaborator

@MjDeck 

Thanks a lot for the advice, but I'm afraid my knowledge is very limited, so I can't handle the whole code myself. Maybe you could help redesign it so that all the dimensions fit correctly. Thank you very much in advance 🙄

0 Likes
Message 6 of 20

WCrihfield
Mentor
Mentor

I think he's talking about this:

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule only works for Drawing Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oChainDimSet As ChainDimensionSet
For Each oChainDimSet In oSheet.DrawingDimensions.ChainDimensionSets
	oChainDimSet.Arrange(oChainDimSet.Members.Item(1))
Next

The ChainDimensionSet object has its own Arrange method.  When calling this method, it wants you to specify a base (LinearGeneralDimension) as input, so it can use that dimension as the basis to arrange all the other 'Members' of the set.  In my example code, I'm simply specifying the first 'Member' of the set as the input general dimension to base the Arrange method on.  Here's the link to the Help page for this.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE' 👍.

If you have time, please... Vote For My IDEAS 💡and Explore My CONTRIBUTIONS

Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 7 of 20

WCrihfield
Mentor
Mentor

There is also a similar method for BaselineDimensionSet shown here.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 8 of 20

robertast
Collaborator
Collaborator

@WCrihfield 

Thanks for trying to help, unfortunately your rule doesn’t work for me
If my iLogic works with errors. 🤔

 

Message 9 of 20

WCrihfield
Mentor
Mentor

That last code would have only worked on real ChainDimensionSets that were created as chain dimension sets when created.  Here is an iLogic rule that attempts to combine all the different types of dimension types and all their different methods for arranging them.  This should catch pretty much any type of dimension you created on your drawing.   Try this:

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule only works for Drawing Documents.",vbOKOnly, "WRONG DOCUMENT TYPE")
	Exit Sub
End If
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Inventor.Sheet = oDDoc.ActiveSheet
Dim oDDims As DrawingDimensions = oSheet.DrawingDimensions
For Each oDDim As DrawingDimension In oDDims
	If TypeOf oDDim Is LinearGeneralDimension Or _
		TypeOf oDDim Is AngularGeneralDimension Then
		oDDim.CenterText
	End If
Next
For Each oBaselineDimSet As BaselineDimensionSet In oDDims.BaselineDimensionSets
	oBaselineDimSet.ArrangeText
Next
For Each oChainDimSet As ChainDimensionSet In oDDims.ChainDimensionSets
	oChainDimSet.Arrange(oChainDimSet.Members.Item(1))
Next
Dim oCollection As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
Dim oLinGenDim As LinearGeneralDimension
For Each oGenDim As GeneralDimension In oDDims.GeneralDimensions
	If TypeOf oGenDim Is LinearGeneralDimension Then
		oCollection.Add(oGenDim)
	End If
Next
oDDims.Arrange(oCollection)

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE' 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 10 of 20

WCrihfield
Mentor
Mentor

I also find it very interesting that the "CenterText" method works, even though there doesn't appear to be any mention of it within the online help page for the DrawingDimension Object.  But it is being used within the sample code.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 11 of 20

robertast
Collaborator
Collaborator

@WCrihfield  Thanks again

still something is wrong  😕.  On the right, as you can see, I added grouped dimensions, but the rule only focused the values ​​but did not match the dimensions. Centering works well @JhoelForshav  wrote a rule on this topic: iLogic 

Message 12 of 20

MjDeck
Autodesk
Autodesk

@WCrihfield , not all dimensions have a CenterText method. But LinearGeneralDimension and AngularGeneralDimension do. Those are both derived from DrawingDimension.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 13 of 20

WCrihfield
Mentor
Mentor

Ah, I see now.  Apparently I didn't dig deep enough when looking into that point before. Thanks for the helpful links.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 14 of 20

robertast
Collaborator
Collaborator

@WCrihfield  is it likely that it will work?

Message 15 of 20

WCrihfield
Mentor
Mentor

That last code I posted worked just fine for me, so I'm not sure why it's not working just as good for you.  I created a screen cast video of me dimensioning one side of a part using regular General dimensions, then dimensioning another side of it using Baseline dimensions, and another side using Chain dimensions.  Then I move the text and positioning of all these dimensions around to create a little chaos for the rule to deal with.  Then I show you the contents of the iLogic rule before I run it.  Then I run the rule, to show you how it acts on my computer.

The video is attached:

And here is the link to the ScreenCast.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 16 of 20

robertast
Collaborator
Collaborator

@WCrihfield 

As you can see, iLogic does this correctly if the Chain dimensions are ungrouped and there is only one such dimension. If a second occurs on the same side, everything is damaged. If the Chain dimensions are grouped, it only centers the text, but the dimension line does not stand in the style.

Since @JhoelForshav  not join the discussion, I try to speculate that it is not possible to do so

Message 17 of 20

WCrihfield
Mentor
Mentor

I see what you mean now.   That scenario of having multiple chain dimension sets on the same side and using the usual iLogic arrange methods definitely leads to unfortunate and unwanted results.  Seems this is one of those things that maybe Autodesk needs to look into further, and possibly offer an update for sometime in the future.  Though it would likely be pretty low on their priorities, since there may not really be that many folks out there attempting to achieve this exact scenario.

  An iLogic solution for this scenario would likely have to go into much more detail than those standard Arrange functions offer, if it is possible at all.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 18 of 20

robertast
Collaborator
Collaborator

Well, most of the designer's work is taken away by dimensioning and handling. The basics of how beautifully working the SW arrange feature started to envy their users. So I tried to get help here so that maybe with iLogic it could be solved and speed up the work while waiting and expecting Autodesk to do it in its program automatically.
@MjDeck  is there any way to do this now? And is there any hope that the Inventor team will do that in the future?

Message 19 of 20

MjDeck
Autodesk
Autodesk

@robertast , are you looking only for improvements in the Inventor API and iLogic?
Or do you also need improvements in the way the Arrange command on the ribbon works?
In other words, does the Arrange command to everything you need, with no programming required?


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 20 of 20

robertast
Collaborator
Collaborator

It would probably be best to do an extra command "arrange all" right in the program. The current one should remain as an option. But it has to work right.

Arrange.jpg

Until such is the case, I was hoping to solve this with the help of iLogic. And if that succeeds, offer Autodesk a ready-made solution.

I was interested in  @JhoelForshav  decision SOLUTION.  

When it resolves dimension centering when text does not fit between dimension lines.

 

Arrange 2.jpg

 

So I’m looking for any quick way to properly arrange the dimensions. This will be very relevant in the new version of 2022 as well, as the annotations in the tarpaulins will run out and have to be handled.