Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Reference dimension

15 REPLIES 15
SOLVED
Reply
Message 1 of 16
madstrolle
770 Views, 15 Replies

Reference dimension

Hi,

We often draw square profiles and other parts dimensions that isn't editable. On these profiles we want these dimensions to be, reference dimensions e.g. (50). 

Is there a way to do this automatically?

Regards

15 REPLIES 15
Message 2 of 16
CCarreiras
in reply to: madstrolle

Can you explain better what's your goal?

 

If you already create the dimensions, You can toggle any ordinary dimension into a reference dimension (and vice-versa)

Select them and click here:

CCarreiras_0-1683891116752.png

If you are about to create the dimensions, You can turn on the button first and then create the dimensions, the dimensions will be all reference dimensions

CCarreiras

EESignature

Message 3 of 16
madstrolle
in reply to: CCarreiras

It's when i'm making a 2D drawing. See picture

madstrolle_0-1683891627541.png

 

Message 4 of 16
madstrolle
in reply to: CCarreiras

If I do that way, I can't change the size in my Ilogic form.

Message 5 of 16
Frederick_Law
in reply to: madstrolle

Maybe use Basic.

Dimension-Ref-02.jpg

 

If not, set up a Style for Reference Dimension.

Message 6 of 16
madstrolle
in reply to: Frederick_Law

Sorry, but it's not working

Message 7 of 16

Hi @madstrolle! Try do use this iLogic rule.

 

Dim oDoc As Document
oDoc = ThisApplication.ActiveDocument
Dim oDim As Inventor.GeneralDimension
Do
	oDim = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Select Dimension")
	If oDim Is Nothing
		Exit Do
	End If
Dim oDrawingDims As DrawingDimension
For Each oDrawingDims In oDoc.ActiveSheet.DrawingDimensions
oDim.Tolerance.SetToReference
Next 	
Loop While oDim IsNot Nothing

 

Message 8 of 16

Not automatic, but it definitely works great, thanks 🙂

Message 9 of 16

Some input information is required to automatically changed specific dimensions. I thought that it is most appropriate to choose the sizes that should be reference dimensions.
If You need to change all dimensions then try this rule

Dim oDoc As Document
oDoc = ThisApplication.ActiveDocument
Dim oDim As Inventor.GeneralDimension

Dim oDrawingDims As DrawingDimension
For Each oDrawingDims In oDoc.ActiveSheet.DrawingDimensions
oDrawingDims.Tolerance.SetToReference
Next 	

 

Message 10 of 16
madstrolle
in reply to: madstrolle

I will try it 🙂

But it would be great if it could be done on the actually part. So every time I place the part and call for the dimensions they are with (reference). I'm using ilogic to  generate these hole profiles.

I hope it makes sence.

madstrolle_0-1684130288148.png

 

Message 11 of 16

Please have a look at the standard Inventor command.
However, be careful, for this, the dimensions in the model must be reference, which can lead to accidental changes in these dimensions. A solution may be to impose a lock in the sketch's constrain. Then the dimensions will be references and the lines will not move anywhere. Please check the short video.

 

 

Message 12 of 16

But then I can't use ilogic to change the dimensions.

 

madstrolle_0-1684145644644.png

 

Message 13 of 16

The error occurs because the sketch geometry is locked.

In this case, there is no way to distinguish the normal size from the reference dimensions. If you have two types of dimensions in your drawing, then:
- If most of the dimensions are referenced, use rule 2 and then manually change the necessary sizes to normal dimensions.
- If most dimensions are normal, then use rule 1 and select those dimensions that should be reference.

Message 14 of 16

There is another way if you work with the templates of these profiles and you can add referenced dimensions to them. But these new additional dimensiones must be linked to another geometry.

Знімок екрана 2023-05-15 140305.png

 

Message 15 of 16

Thank you.

Together with the rule, this is perfect.

Message 16 of 16

Hi @dimamazutaMMJ32 ,

 

I'm using this rule all the time, it's working great😊

Would it be possible to change the code, so it also works for "Ordinate Set"?

 

madstrolle_0-1695799877348.png

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report