Quantcast
Channel: From the Trenches with Autodesk Inventor
Viewing all articles
Browse latest Browse all 61

Open Drawing From Balloon

$
0
0





Issue:

You'd like to be able to open a component drawing by selecting a balloon from an assembly drawing.

Solution:

Here is an iLogic rule that uses a bit of API code to do this.


DimoDocAsDrawingDocument = ThisApplication.ActiveDocumentWhileTrue'select BalloonDimoBalloonAsBalloon = NothingoBalloon = ThisApplication.CommandManager.Pick _
	(SelectionFilterEnum.kDrawingBalloonFilter, _
	"Select a balloon to open it's drawing. "& " (press ESC To Exit selection)")

	IfIsNothing(oBalloon) ThenExitWhileDimoLeaderAsLeaderIfoBalloonIsNotNothingThenoLeader = oBalloon.LeaderDimoLeaderNodeAsLeaderNode = oLeader.AllNodes(oLeader.AllNodes.Count)
	DimoIntentAsGeometryIntent = oLeaderNode.AttachedEntityDimoCurveAsDrawingCurve = oIntent.GeometryDimoOccAsComponentOccurrence = oCurve.ModelGeometry.ContainingOccurrenceDimoRefDocAsDocument = oOcc.Definition.DocumentDimoFilePathAsString = oRefDoc.FullFileName()
	DimoDrawingFilePathAsString = Left(oFilePath, Len(oFilePath) -3) & "idw"TryoDrawDoc = ThisApplication.Documents.Open(oDrawingFilePath, True)
		ExitWhileCatchMsgBox("Could not open "& oDrawingFilePath, , "iLogic")
	EndTryEndWhile

Viewing all articles
Browse latest Browse all 61

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>