DetailView Update Definition in Base View - Move Label

DetailView Update Definition in Base View - Move Label

insomnix
Advocate Advocate
882 Views
5 Replies
Message 1 of 6

DetailView Update Definition in Base View - Move Label

insomnix
Advocate
Advocate

I have some code that creates a detail view. A copy of the code can be found on a previous post. Everything was looking good until I ran into a situation where the label was overlapping a dimension. I would like to move the label into another position. As far as I can tell there is nothing in the knowledge base that looks like it would move this label. Maybe I'm just missing it.

 

image.png

883 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable

We used this bit of code to move the label on a view. U might be able to pick the bones out for what you want...??

 

Sub CreateSheetTank(oApp As Inventor.Application, oPartDoc As Inventor.PartDocument, viewConfigsTank As ViewConfigTank(), borderFilename As String)
'Dim sTemplateFile As String = "O:\Inventor\Templates\A3 Yorkshire Water Contract Border.dwg"
Dim sTemplateFile As String = "O:\Inventor\Templates\" & borderFilename

' create new doc with 1 sheet
Dim oDrawDoc As DrawingDocument = oApp.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, sTemplateFile)
Dim oSheet As Sheet = oDrawDoc.Sheets.Item(1)

Dim viewConfigTank As ViewConfigTank
For Each viewConfigTank In viewConfigsTank

' view insertion point
Dim oPlacementPoint As Point2d = oApp.TransientGeometry.CreatePoint2d(viewConfigTank.X, viewConfigTank.Y)

' create view
Dim oView As DrawingView = oSheet.DrawingViews.AddBaseView(oPartDoc, oPlacementPoint, viewConfigTank.Scale, viewConfigTank.Orientation, viewConfigTank.Style, "Master")

' create work points
Const dimOffset = 1
AddWorkPoints(oApp, oView, oSheet, viewConfigTank.WorkPointPairs, dimOffset)

oView.Name = viewConfigTank.Name
oView.ShowLabel = True

' shift label down a bit
Dim bottomOfView As Double = oView.Position.Y - (oView.Height / 2.0)
oView.Label.Position = oApp.TransientGeometry.CreatePoint2d(oView.Label.Position.X, bottomOfView - dimOffset - 0.2)
Next

End Sub

0 Likes
Message 3 of 6

insomnix
Advocate
Advocate

When creating a detail view, it has the same properties and methods as a standard view plus some additional ones because of its connection to a standard view. The code you provided does indeed show a method for moving the position of the label, but not the label in the definition in the base view. It moves the label on the detail view.

 

An example of the code I have that defines the position and text of that label and an image of the view that was created:

        ' Create the detail view.
        Dim oDetailView As DetailDrawingView
        oDetailView = oSheet.DrawingViews.AddDetailView(oDrawingView, oPoint, DrawingViewStyleEnum.kFromBaseDrawingViewStyle, True, oCenterPoint, 0.4, , 0.5, True, "A")
        oDetailView.Label.Position = oTG.CreatePoint2d(oDetailView.Label.Position.X, oDetailView.Label.Position.Y + 0.3)
        oDetailView.Label.FormattedText = "DETAIL <DrawingViewName/>"

image.png

 

What I cannot find is the method for connecting to the base view to change the position of the label within the definition. 

Message 4 of 6

insomnix
Advocate
Advocate

I'm still trying to find a solution for this. Any help would be appreciated.

0 Likes
Message 5 of 6

dgreatice
Collaborator
Collaborator

Hi,

 

via API inventor? I think it cant be, because no object library in API to access label Detail/Section View Label Definition.

Please use the ACCEPT AS SOLUTION or KUDOS button if my Idea helped you to solve the problem.

Autodesk Inventor Professional Certified 2014
0 Likes
Message 6 of 6

raphael.widmann5DUKP
Participant
Participant

Hi guys,

 

old topic, but is there any solution for this already? I have a similar issue when you want to reposition this "Base" of DetailView (don't know how this is technically called, but I mean the circle or rectangular, that clipps the Area, that should be shown in the DetailView).

raphaelwidmann5DUKP_0-1725611144971.png

Cant imagine, that there's no posibility to acces this object!? But I cant find anything with the VBA Editor...

Edit: I did found a lot of posts and also in the API Help showing how to recreate a new DetailView (that creates a new Base of course) - but to keep all the Dimensions on the DetaiView, it would be much easer just to move the Base of the Detail.

PUSH: Any help would be appriciated!

Thanks a lot!

Raphael

0 Likes