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: 

ILOGIC AUTOMATIC VIEW SCALE LABEL FOR EACH SHEET CREATED IN THE SAME FILEDRAWING

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
brunobiazotti
1924 Views, 7 Replies

ILOGIC AUTOMATIC VIEW SCALE LABEL FOR EACH SHEET CREATED IN THE SAME FILEDRAWING

Hi guys.

 

I have multiple sheets in the same drawing file. In each sheet a different part will be detailed, ok here.
So, for each detailed drawing sheet I would like to have an ilogic automatic fill the field of scale of the title block, according with the respective part placed in the sheet.

 

For example, i have two parts detailed in the same file, but in the diferent sheets, ok? In the first sheet I have a placed view of the one part in 1:1 scale, but in the second sheet the other part have an view placed with 1:2 scale. So, in the each title block sheets will have an diferent scale automatic filled.

 

Print screen attached.

 

Thanks for any help.

7 REPLIES 7
Message 2 of 8
ewiggers
in reply to: brunobiazotti

Hello,

 

May I point out something about the drawing technique you apply here. When you check the drawing standard about scale (don't know the NEN-ISO number by head at this moment but I can look it up later). It describes that the titleblock on each sheet should contain the main scale of the drawing. For each different scale on a view the scale should be included into the view label.

 

If I understand it correct, you put multiply parts into one drawing, for what purpose? Why don't you put each part or assembly into a single drawing file, with its unique number etc.

 

At our company we use a rule for scale automation, but it puts the main drawing scale into the titleblock. I think it will be possible to achieve what you have in mind. You have to create a Prompted Entry field in your titleblock. Create a iLogic rule that will get the scale from the view on each sheet and put that text into the Prompted Entry field.

 

Regards,

Eelco

Message 3 of 8
ewiggers
in reply to: ewiggers

Hello,

 

Just tested it and the code below wil do the job for you.

 

Do the following:

- Create a prompted entry "Scale" in your titleblock definition(s).

- Create a new rule "SetScale" or whatever name you like.

- Insert the code below into that rule.

- Set the event trigger Before Save Document  for this rule.

 

Code:

Option Explicit
' Set the scale on each sheet individual
Try
	Dim oActiveDoc As Document = _ 
	TryCast(ThisApplication.ActiveDocument, Drawingdocument)
	Dim sScaleText As String
	
	' Check if activedoc is nothing, if so than exit
	If (oActiveDoc Is Nothing) Then Exit Sub
	
	' Loop thru the sheets and get scale from the first view
	For Each oSheet As Sheet In oActiveDoc.Sheets
		If (Not oSheet.DrawingViews.Count = 0) Then
			sScaleText = oSheet.DrawingViews(1).ScaleString.ToString
			For Each oTextBox As TextBox In oSheet.TitleBlock.Definition.Sketch.TextBoxes
        		If (Strings.Left(oTextBox.FormattedText, 7) = "<Prompt") Then
					If (Strings.Instr(oTextBox.FormattedText, "Scale", _
						Microsoft.VisualBasic.CompareMethod.Text) <> 0) Then
						oSheet.TitleBlock.SetPromptResultText(oTextBox,sScaleText)
					End If
        		End If
    		Next oTextBox		
		End If
	Next oSheet
	
Catch ex As Exception
	MsgBox("Error info: " & vbNewLine & ex.Message, vbOKOnly, "Error: SetScale")
End Try

 

Regards,

Eelco

Message 4 of 8
brunobiazotti
in reply to: ewiggers

Hi Eelse

Currently we use exactly this method that you said on inventor, one file, one drawing detailed, one part number, using an ilogic rule puts the main drawing scale into the titleblock. In the drawing detailed of the assembly, we need only one file, so this rule is solution.

But to drawings detail of the parts of the assembly, we get a conclusion that the better method for us is one file for multiple drawing detailed (for parts of the same assembly).

This method is already use by us in autocad, the same file contain several detailed drawings. I do not quite agree with that, but I can not make a decision without the permission of my manager partner.

So, I appreciated for your help and I go try the solution that you give us above.
Thanks, I will be back for accept this solution with KUDO!
Message 5 of 8
brunobiazotti
in reply to: ewiggers

Eelco,

 

It works! 

 

One more thing, when I place a new sheet through "Drawing Resources" → "Sheet Format" the "prompt entry text box" open automatically and request the value. Off course, I not fill it and I made only CANCEL or OK, then rule that you made work when I place one view.

 

But, how made to not show the "prompt entry text box" when I place a new sheet?

file attached

 

Regards

Bruno

Message 6 of 8

 

INSERTING NEW SHEET → PROMPT BOX SHOW AUTOMATCALLY

 

ADD NEW SHEET - PROMPT BOX SHOW AUTOMATCALLY.jpg

Message 7 of 8
ewiggers
in reply to: brunobiazotti

Hi brunobiazotti,

 

I have been looking into that earlyer but it is not possible to suppres or not show the prompted entry dialog when inserting a sheet. This is part of the insert sheet command in Inventor and is hard coded.

 

I found a solution for our company, not because we use prompted entry's but to make use of the default Inventor border. When you use the default border in your drawings, Inventor let you adjust the sheet margins when you choose insert Default Border from the drawing resources folder. But when you change the sheet size after the sheet is inserted, Inventor sets back the sheet margins to standard values and they are hard coded and not adjustable. Unfortunaly they didn't meet the drawing standard for sheet margins and they set the sheet margins to 10 mm on all sides for A4 to A2 and for A1 to A0  they set the margins to 20 mm on all sides. I have reported that as an issue and they will fix it somewhere in a future release.

 

For your purpose you must create an iLogic rule that inserts a new sheet. You can create a dialog with a combobox where the user can choose the sheet sizes from and according that choice insert the approate sheet with border and titleblock. Within the rule get the prompted entry textbox and fill it with an empty string and use the command AddTitleBlock to add the titleblock with prompted entry's to the sheet. This way the prompted entry dialog will not appear.

 

Regards,

Eelco

Message 8 of 8
brunobiazotti
in reply to: ewiggers

Well, this box prompt shows is not so bad, and the users can live with this. Is only click on OK with none value on the field, and done!
Much appreciated your help Mr. Wiggers

Regards
Bruno Biazotti

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

Post to forums  

Autodesk Design & Make Report