Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing Code to Dimension Part Instead of Assembly

1 REPLY 1
Reply
Message 1 of 2
NFarmerN5VGS
111 Views, 1 Reply

Changing Code to Dimension Part Instead of Assembly

I'm attempting to update some code so it works to automatically dimension a part instead of what it was originally written for, an assembly. The same points that are referenced for dimensioning exist in this part the same as they did in the assembly environment. 

 

NFarmerN5VGS_0-1709765348258.png

 

Below is the chunk that I'm currently stuck on. Any help would be greatly appreciated.

   Dim oPartDocument As Inventor.PartDocument
  oPartDocument = thispart
  
  ' Array To Hold Instances of WorkPoints from WireFrame
  Dim oWPBox As New ArrayList
  For Each oDimPts As Inventor.WorkPoint In oPartDoc.ComponentDefinition.WorkPoints
	  ' Only Loop throuhg DimPts from Wireframe to limit confusion with DB Points
	  If (oDimPts.Name.Contains("Dim")) Then
		Dim oWPProxyHolder As Inventor.WorkPointProxy
		oPartDocument.CreateGeometryProxy(oDimPts, oWPProxyHolder)
		oView.SetIncludeStatus(oWPProxyHolder,True)
		oWPBox.Add(oWPProxyHolder)
		End If
  Next
  Call AddLinearDimensions(oDrawingDocument,oSheet,oWPBox)
  Call DefineDimensionFormat(oDrawingDocument, oSheet)
End Sub

 

1 REPLY 1
Message 2 of 2
A.Acheson
in reply to: NFarmerN5VGS

Hi @NFarmerN5VGS 

If you have no assembly then you can remove the proxy workpoint creation lines. You should work directly to include the workpoint object. 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report