AutoCAD Inventor :: Create Workplane From A Face In Assembly Document
Jul 15, 2011
In an assembly document, I try to add a MateConstraint between male and female side of an 45 degrees elbow. The male side is built on the XZ Plane and Y Axis And I try to create a workplane on the female face.
But a got an error with the last line of code. Here's my code (vb.net code) :
' Get application object
Dim app As Inventor.Application = GetObject(, "Inventor.Application")
Dim doc As Inventor.AssemblyDocument = app.ActiveDocument
if there is any way to create a new 'FeatureBasedPattern' within an assembly document. I have 2 assembly occurences - parts. In the Part1 i created a RectangularPattern of workpoints. The Part2 is going to be used in the new pattern. I tried the following VBA code, but it doesn't work.
Dim oPart1 As ComponentOccurrence Set oPart1 = oAssDef.Occurences.Item(1) Dim oPart2 As ComponentOccurrence Set oPart2 = oAssDef.Occurences.Item(2) Dim oTG As TransientObjects Set oTG = ThisApplication.TransientObjects [code]...
The Call function breaks with: "Invalide procedure call or argument". I also tried "Set oAssemblyPattern = oAssDef.OccurencePatterns.etc...." instead of Call function, but with the same result. Same error for declaration change of "oAssemblyPattern" to "FeatureBasedOccurrencePatternProxy".
I have assembly file in which I have created a work plane "Work Plane19" . Now I wanted to create a new work plane which will be paralle to workplane "WorkPlane19" & offset by 10.5 mm in same assembly document through VBA subroutine. I have tried with following code but getting error,
Public Sub NewWorkPlaneCreate() Dim oAssly As AssemblyDocument Set oAssly = ThisApplication.ActiveDocument
From a VB.Net program, I'm trying to create a dimension on a drawing document between two parts in an assembly. I can get the parts using component occurrence. The line marked below throws the following error: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)).
As you may see, I have allocated memory for both "Edge" and "Face" (Dim oEdge1 As Face) albeit one is commented out. Attached is the screen shots from the attribute helper add-in. In it, you will notice that the attributes are of type: "Face".
Public Sub CreateDrawingDimension(ByVal Part1 As String, ByVal Part2 As String, ByVal AttName1 As String, ByVal AttName2 As String) ' Get the Active Drawing document Dim oDrawDoc As Inventor.DrawingDocument oDrawDoc = invApp.ActiveDocument [code]........
How can I create a workplane with the API that is tangent to a surface and passes thru a workpoint. It is easy to create a work plane of type kPointAndTangentWorkPlaneDefObject by point and click in Inventor 11, but I can't figure out how to do it in the API.
I am trying to create a workplane by a point and a line. I can do this maually, but have not been able to reproduce this in code.
BTW: I realize I can create a fixed workplane by using the point, the edge, and an edge perpendicular to the edge, but I cannot have this as a fixed workplane.
What is the best way to create a workplane at a given angle on the surface of the tube. Imagine the workplane long and thin running along the surface of the tube. The angle will be a parameter (from a sketch or user).
I'd like the workplane to always be on the surface of the tube, even when the diameter of the tube (from a dimension in a sketch) changes.I'm thinking that a (angled) line in the same sketch as the two circles (which define the tube diameter and thickness) would be a good starting point.
There are many examples of creating rectangular patterns, but not many, if any, of interrogating existing patterns.I have attached the files and a screenshot of a rectangular part inside an assembly. The part contains a rectangular pattern of holes and workplanes.how do I get hold of each proxy of the workplane in the pattern?In other words I don't know what to put in the for loop at the end of this code fragment:
If _invApp.Documents.Count = 0 Then MsgBox("Need to open an the assembly document") ReturnEnd If If _invApp.ActiveDocument.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then MsgBox("Need to have an Assembly document active") ReturnEnd If Dim asmDoc As Assembly Document asmDoc = _invApp.ActiveDocument Dim asmDef As AssemblyComponentDefinition asmDef = asmDoc.ComponentDefinition im occurrences As ComponentOccurrencesoccurrences. [code]....
I need to be able to pick a face on a part in an assembly inside a iLogic rule. How can I set up the events to suspend the code to have the user pick the face?
There are instances where we need to add an extrusion in an assembly (.iam) to show labeling that needs to be done on the floor during assembly.
So we do a new sketch to the face where we need to add the "label", we use text and extrude it 0.001" deep (cut).
On the drawing (.idw) you can see it no problem, but in the model (.iam) itself it's hard to see since the faces that result from the extrusion are the same color as the participant part.
My question is this: Is it possible to change the color of the face of the extrusion?
It's not super important but it would be a good thing to show that detail as we sometimes print a color version of the 3D view for prototyping, troubleshooting, etc.
what im trying to do is select a face in an assembly and create a sketch on it in the part level
this is just one step in the program im trying to make the overall program will create a tube frame and the tubes will be driven from a base solid
Sub test1() Dim asmDoc As AssemblyDocument Set asmDoc = ThisApplication.ActiveDocument Dim asmDef As AssemblyComponentDefinition Set asmDef = asmDoc.ComponentDefinition [code]......
I am trying to pinpoint the center of gravity on a curved face of an assembly. I can use the c og G command to get the true center of gravity but i would like to incorporate lifting eyes into the finished assembly. Basically I need to know how to find the C of G on a given surface. I have attached the assembly I am working on and added lifting eyes roughly where I would like them. I have tried measuring from the C of G to a face and then creating the lug above the C of G but somehow it doesn't line up.
I was wondering if there is a way to change the appearance of a face in a weldment assembly environment. I have a weldment which in the machining process a part of weld bead as well as a portion of one of the components is machined down (spot faced) and I need to change the appearance of those face to polished, but it doesn't let me do that?
in inventor VBA, is it possible to get all reference documents without opening an assembly file in inventor?
this is i am using right now,
Dim oAssyDoc As AssemblyDocument Set oAssyDoc = oInvApp.Documents.Open(sAssyPath) oAssyDoc.Update Dim oAllRefParts As DocumentsEnumerator If Check1 = True Then Set oAllRefParts = oAssyDoc.ReferencedDocuments Else Set oAllRefParts = oAssyDoc.AllReferencedDocuments End If
Autodesk Inventor Professional 2014 Autodesk Product Design Suite Standard 2013 Microsoft Office 2007 & 2013 Windows 7 64bit Synergis Adept 2013 Visual Studio Express 2010
I'm trying to write my first VBA program for Inventor with very little programming experience. I would like to create a userform which displays the materials list within a combobox.
The problem I have is that I would like the userform to remain open no matter which type of file is active. I would like the combobox to display the material list and current material when in a Part file and display N/A when in Assembly file.
I've tried opening an Inventor Assembly file (.iam) with Microsoft Word, Notepad, and Wordpad but there is a big problem with text conversion. When I open them I get radical characters that makes it impossible for me to make sense out of.
My hope was to open an assembly file as a text document and modify it to get a different result when opening the model (i.e.- moving a part from one position to another in the assembly by modifying text). Sort of like when I modify a post processor in MasterCAM to produce a different program with if/then statements or changing text. Ultimately I want to create an assembly model that reflects our inventory as sort of a "virtual warehouse" where a quick look at the model would let you know where you have space to move and store new inventory.
I think being able to modify inventory locations by modifying text and letting the model update would be faster and easier than someone modifying the model at the end of each day with Inventor.
Is there any type of text conversion software that could take an Inventor assembly file and convert it into readable text?
I am trying to create a sketch on a face for an extrusion. The sketch has a text box. I am having trouble excluding the text in a sketch otherwise all the closed geometries of the text get extruded.
I created an objectCollection and excluded the TextBox objects. Still not working.
I want to put my iFeature on my workplane,but i can't.However, if I change my PlaneInput = oFace , it can work perfectly.My program is below:
Private WithEvents oInteraction As InteractionEvents Private WithEvents oselect As SelectEvents Private Sub UserForm_Initialize() Set oInteraction = ThisApplication.CommandManager.CreateInteractionEvents Set oselect = oInteraction.SelectEvents
I want to use a lofted solid as a component in an assembly. I am using a top-down approach with 2D blocks to get the kinematics right before creating the components.
My problem is that the sketches needed to create the loft are on workplanes, and those workplanes are fixe with respect to an absolute coordinte system.
Is there a way to assosiate workplanes with a block instead, so that they will move with the part?
Is it possible that the problem is trying to do this in a part file, and that if I place the finished solid in an assembly it will then be able to move? ( I am fairly new to Inventor.)
I created a sketch on a 'fixed workplane' and extruded it. I would like to know if it is possible to move the workplane? I understand I can change the workplane if it is a 'plane by offset from plane'.
If moving a fixed workplane is possible, does the extruded features move along together?
I can't create a dwg from an assembly because it's telling me that "The factory must be updated before views of it's members can be used". What does this mean and how do you update the factory?
All I need to do is merge a circular face to a flat face, so both faces become one continuous face. Is this possible at all?
I have a attached a screenshot to show what I mean. Face 1 needs to be merged with face 2. This is so if I constrain anything to that face it will constrain to the entire face and not either the circular face OR the flat face.
My part unit length has been setup as millimeter(mm).Once I created a line within 2d sketch by VBA script, the result of length always become to 10 times of value.For example, the two points of line is (0,0) and (0,4). But the result of length measured is 40.
My problem is how to create a line with part document setting?
I am trying to create a new base view in drawing-document.
I can get hold of the view but cant find a way to set reference data --- would like to set the "Line Style" to "As Parts" and "Hidden Line Calculation" to "All Bodies".