How to scale rectangular detail views

How to scale rectangular detail views

gabriele.tittonel
Contributor Contributor
360 Views
3 Replies
Message 1 of 4

How to scale rectangular detail views

gabriele.tittonel
Contributor
Contributor

I have a rule to scale (rounded) detail views and I was wondering how adapt this rule for rectangular shaped detail views.

To scale the detail view, I have to scale first the fence radius, which I do this way:

 

 

' To access the fence radius, we need to use the "Item(i)" method: 
' my case, the detail view Is the third one, and the label Is "B". 
Dim oDetail As DetailDrawingView
    oDetail = ThisDrawing.Document.ActiveSheet.DrawingViews.Item(3)
    oDetail.FenceRadius = ActiveSheet.View("A").Width * 0.1

 

 

I guess there's a similar property to control the dimension of the detail, but so far, I haven't found it.

I've tried both: oDetail.Width and oDetail.Height but they are "read only" and so...

Any idea?

0 Likes
Accepted solutions (1)
361 Views
3 Replies
Replies (3)
Message 2 of 4

Andrii_Humeniuk
Advisor
Advisor

Hi @gabriele.tittonel . To control the fence of a rectangular DetailView, you need to get the properties: FenceCenterFenceCornerOneFenceCornerTwo.

An example of obtaining functions:

Dim oInvApp As Inventor.Application = ThisApplication
Dim oView As DrawingView
Do
	oView = oInvApp.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select View...")
	If oView Is Nothing Then Exit Sub
Loop While oView.ViewType <> 10502
Dim oDView As DetailDrawingView = oView
Try : Dim dR As Double = oDView.FenceRadius : Catch
	Dim oCPoint As Point2d = oDView.FenceCenter
	Dim oPoint1 As Point2d = oDView.FenceCornerOne
	Dim oPoint2 As Point2d = oDView.FenceCornerTwo
End Try

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 3 of 4

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@gabriele.tittonel, I'm a little unclear as to what you're doing , but I'm thinking you will need to use some combination of these properties

 

DetailDrawingView.FenceCornerOne 

DetailDrawingView.FenceCornerTwo 

https://help.autodesk.com/view/INVNTOR/2025/ENU/?guid=GUID-DetailDrawingView

 

Hope that helps.

 

But to just scale a rectangular detail view you can do something like this:

Dim oSheet = ThisDrawing.ActiveSheet
'parent view
Dim oView = oSheet.DrawingViews.ItemByName("VIEW1")
'detail view
Dim iDetailView = oSheet.DrawingViews.ItemByName("B")

'get the Inventor API object from the iLogic object
Dim oDetail As DetailDrawingView = iDetailView.View

If oDetail.CircularFence = False Then sType = "Rectangular"

'set the view scale to be 2x the parent view
oDetail.Scale = oView.Scale * 2

MsgBox(sType & " Detail is 2x it's parent view",, "iLogic")

'scale again by 10%
oDetail.Scale  = oDetail.Scale *1.1

MsgBox(sType & " Detail is scale " & oDetail.ScaleString ,, "iLogic")

 

EESignature

0 Likes
Message 4 of 4

gabriele.tittonel
Contributor
Contributor

@Curtis_Waguespack : Yes, it looks exactly what I need! 

 

Also, interesting the "ItemByName" approach! 😀