Choose specific drawing template using i logic

Choose specific drawing template using i logic

didin.suryadi6JREK
Advocate Advocate
1,119 Views
5 Replies
Message 1 of 6

Choose specific drawing template using i logic

didin.suryadi6JREK
Advocate
Advocate

Hi,

 

I am thinking to have i-logic to choose the specific drawing styles on the drawing template.

didinsuryadi6JREK_0-1632362402379.png

 

Now I do it manually every time I make the drawing, if we can do it with i-logic that would be faster.

 

I appreciated those who can help on this matter. 

 

 

Rgds

 

 

 

0 Likes
Accepted solutions (1)
1,120 Views
5 Replies
Replies (5)
Message 2 of 6

smilinger
Advisor
Advisor
doc = ThisDrawing.Document
doc.StylesManager.ActiveStandardStyle = doc.StylesManager.StandardStyles("Default Standard (ANSI)")
0 Likes
Message 3 of 6

didin.suryadi6JREK
Advocate
Advocate

Hi

 

Thanks for the code, Sorry if I wasn't clear on the request. I want the list of the styles that come upon the box since I have some styles to choose from. Ie I will choose ANSI for a part, or I will choose ISO for assembly.

Could you please help?

 

0 Likes
Message 4 of 6

WCrihfield
Mentor
Mentor
Accepted solution

Maybe this is more like what you were looking for?  If gets the list of available drawing standard styles, then presents that to you, and asks you to choose one.  Afterwards it confirms that a selection was made, then sets that style as the 'active' standard style.

Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSStyles As New List(Of String)
For Each oSS As DrawingStandardStyle In oDDoc.StylesManager.StandardStyles
	oSStyles.Add(oSS.Name)
Next
oChoice = InputListBox("", oSStyles, "", "Drawing Standard Styles", "Drawing Standard Styles List")
If String.IsNullOrEmpty(oChoice) Then Exit Sub
Dim oStyle As DrawingStandardStyle = oDDoc.StylesManager.StandardStyles.Item(oChoice)
oDDoc.StylesManager.ActiveStandardStyle = oStyle

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

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 5 of 6

WCrihfield
Mentor
Mentor

@didin.suryadi6JREK

You could put this rule under the 'New Document' event in the Event Triggers dialog, to have it automatically run this rule when you start a new drawing.  You could either set this up within the Template drawing file, or in the 'Drawings' tab of the Event Triggers dialog, then under the 'New Document' event in that tab, if you want it to effect all new drawings, no matter which template they are started from.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 6 of 6

didin.suryadi6JREK
Advocate
Advocate

Hi Wesley

 

Thanks for the code. Actually, when I make a new drawing there will be only 2 choices on the template. So I have to choose it manually. So the code is not needed in this case.

Anyway, I used the code you sent to convert and update the old drawing (very old). It's Working

 

Thanks

0 Likes