Set DrawingStyle of DrawingView

Set DrawingStyle of DrawingView

Anonymous
Not applicable
510 Views
7 Replies
Message 1 of 8

Set DrawingStyle of DrawingView

Anonymous
Not applicable

Hi all,

 

I am trying to use iLogic code to place 2 drawing views (a base view and a section view). However, even though I set the document standard style in the iLogic code, the views placed by the code refuse to be first angle projection. I was wondering if theres anyway I am supposed to define the drawing style in the function for the drawing views themselves.

 

Thanks.

0 Likes
511 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Bumping for visibility!

 

Here's my (relevant) code:

 

SyntaxEditor Code Snippet

Dim oModel As PartDocument
Dim oDocs As Documents = ThisApplication.Documents
Dim oDrawingDoc As DrawingDocument = ThisApplication.ActiveDocument
Dim oFormat As SheetFormat
Dim oSheet As Sheet

SyntaxEditor Code Snippet

Dim oStyle As DrawingStandardStyle = oDrawingDoc.StylesManager.StandardStyles.Item("Core Drafting 2015")

 SyntaxEditor Code Snippet

oStyle.FirstAngleProjection = True
oDrawingDoc.StylesManager.ActiveStandardStyle = oStyle

oView2 = oSheet.DrawingViews.AddSectionView(oView1, oSectionDrawSketch, oViewLoc3, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle)
0 Likes
Message 3 of 8

BrandonBG
Collaborator
Collaborator

This may be a quirk of how the active styles work in iLogic, but I found that I had to apply the style to the view/parts list/whatever after the the thing was placed in the drawing.

 

I'm not sure how you can apply a drawing style to a specific section view.

 

Have you tried setting the active drawing style in one rule, and then add the section view?

 

Brandon

 

 

 

0 Likes
Message 4 of 8

Anonymous
Not applicable

I am not sure what you mean. I have tried setting the style at every point. Here is a link with more updated information on my issue.

 

http://forums.autodesk.com/t5/inventor-customization/ilogic-first-angle-projection/m-p/5716472#M5734...

0 Likes
Message 5 of 8

BrandonBG
Collaborator
Collaborator
Okay, I see. In your Style Manager, does "Core Drafting 2015" use first or third? What style does the drawing template use? First or third? If you are using both first and third in the same drawing, you may need to set up two unique styles and activate them per base view. Brandon
0 Likes
Message 6 of 8

Anonymous
Not applicable

Hi Brandon,

 

In my styles manager, Core Drafting 2015 is set to first angle. I need everything to be in first angle projection, I dont want third angle anywhere. I set the active style to Core Drafting 2015 but the section view still shows as third angle. I dont have anything set to third angle so I dont know why it defaults the section view to third angle. If I do everything manually, it creates the section view in first angle.

0 Likes
Message 7 of 8

BrandonBG
Collaborator
Collaborator
I'm going to assume that you've messed around with this line, but does it behave the same with the boolean set to FALSE? This seems like a bug to me also. oStyle.FirstAngleProjection = True Are the base view and projection placed in the same rule? I think the FirstAngleProjection is tied to the base view rather than the projection. Brandon
0 Likes
Message 8 of 8

Anonymous
Not applicable

Hi Brandon, 

 

I just tried it and no, changing the FirstAngleProjection does not affect anything. I see no difference in my view between when it is false and true. And my section view and base view are created in the same rule. You say that the first angle projection property is assigned to the base view. However, what is really strange is that although my rule creates the section view in third angle, if I delete JUST the section view, then manually right click the same base view and create a section view, it creates a first angle. The similar issue is discussed in the post I linked above.

0 Likes