How to set Detail Label to left side of Detail View in Inventor idw.

How to set Detail Label to left side of Detail View in Inventor idw.

mark.mohling
Participant Participant
358 Views
3 Replies
Message 1 of 4

How to set Detail Label to left side of Detail View in Inventor idw.

mark.mohling
Participant
Participant

I am very new to iLogic and VBA in Inventor .idw.  I have custom layout for my assembly drawings.  I need to change the Detail Label location from the bottom to left side of detail view.  Is there is any I can do to make this happen with iLogic or VBA?  Thanks.

 

Mark

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

A.Acheson
Mentor
Mentor
Accepted solution

Hi @mark.mohling 

To start with the drawing view label object has a position property so it can be moved. The next thing is how to access the object this is from the drawing view label property.

This is assuming you have a view allready selected via pick command or drawing view loop. There is a few more pieces to moving but if you search these objects in the forum you can find a sample to work with. 

 

Syntax

DrawingView.Label() As DrawingViewLabel

Syntax

DrawingViewLabel.Position() As Point2d

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 4

mark.mohling
Participant
Participant

Thank you for your reply.  I will give the code a try.

0 Likes
Message 4 of 4

Curtis_Waguespack
Consultant
Consultant

Hi @mark.mohling ,

 

I had this example on hand. I'll add it here in case it is of interest to you or someone else in the future.

 

See the attached 2023 files.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

Sub Main
	Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry

	'get the sheet
	Dim oSheet As Sheet
	oSheet = oDrawDoc.ActiveSheet

	'get base view
	Dim oBaseView As DrawingView
	oBaseView = oSheet.DrawingViews.Item(1)

	Dim DetailViewName As String = "H"

	'[ delete view if it already exits
	For Each View As DrawingView In oSheet.DrawingViews
		'delete view from previous try if it exists
		If View.name = DetailViewName Then
			Try : View.Delete : Catch : End Try
		End If
	Next
	']

	Dim oViewCenterPoint As Point2d
	oViewCenterPoint =  oTG.CreatePoint2d(oBaseView.Center.X/1.5, oBaseView.Center.Y*1.5)

	'get the first curve segment in the base view
	Dim oDrawCurveSegment As DrawingCurveSegment
	oDrawCurveSegment = oBaseView.DrawingCurves.Item(1).Segments.Item(1)

	'create an intent object from the segment
	Dim oGeomIntent As GeometryIntent
	oGeomIntent = oSheet.CreateGeometryIntent(oDrawCurveSegment.Parent, oDrawCurveSegment.Parent.EndPoint)

	Dim oDetailPlacePoint As Point2d
	oDetailPlacePoint = oTG.CreatePoint2d(oBaseView.Center.X + 10, oBaseView.Center.Y)

	Dim oDetailView As DrawingView
	oDetailView = oSheet.DrawingViews.AddDetailView(oBaseView, oDetailPlacePoint,
	DrawingViewStyleEnum.kHiddenLineDrawingViewStyle,
	True, oViewCenterPoint, 2, oGeomIntent, 0.125, True, DetailViewName)


End Sub

 

 

 

EESignature

0 Likes