Looking for Advice - iLogic drawn parts & revisions

Looking for Advice - iLogic drawn parts & revisions

llorden4
Collaborator Collaborator
116 Views
1 Reply
Message 1 of 2

Looking for Advice - iLogic drawn parts & revisions

llorden4
Collaborator
Collaborator

(Currently using 2023.4)

I have developed several part templates that provide user inputs (stored to Parameters) and I use iLogic to quickly handle the sketches and features of the various parts.  These parts have many options (bends, # of holes, size of holes, location of holes, angles, etc...)

 

I originally started with pre-drawn features and using iLogic to handle suppression of features that were not required for the current design.  The benefit to this approach was that on drawings, dimensions & notations remained dynamically available and updated with any changes to the design.  The downside was that suppressed features would often fail to constrain/resolve in the suppressed sketch and cause errors (design doctor activates) and would often interrupt the operation of the iLogic code.

 

I'm now using iLogic to generate sketches for only the features needed and generating the required loft/extrusion/bend/etc. to create the finished part.  For simplicity, any revision process erases all sketch entities and regenerates all new entities based upon the updated part features and values.  While this eliminates all issues with suppressed sketches that fail to resolve (since they no longer exist), all sections, details, dimensions, constraints & notations become dissociated on the drawing and are removed by Inventor for anything related to that part, requiring a complete redo of all this work. 

 

For constraints, I have developed custom work planes/axis/points as constraint features and these I do not delete, but rather re-define their origin points to get them to relocate as needed. For example:

'top plane
Found = False
For Each oWorkPlane In oCompDef.WorkPlanes
	If oWorkPlane.Name = "Top Plane" Then Found = True
Next
PlanePoint(1) = oTG.CreatePoint(0, Height / 2 * 2.54, 0)
PlanePoint(2) = oTG.CreatePoint(1, Height / 2 * 2.54, 0)
PlanePoint(3) = oTG.CreatePoint(0, Height / 2 * 2.54, -1)
midLine = oTG.CreateLineSegment(PlanePoint(1), PlanePoint(2))
oAxisX = midLine.Direction
midLine = oTG.CreateLineSegment(PlanePoint(1), PlanePoint(3))
oAxisY = midLine.Direction
If Found Then
	oWorkPlane = oCompDef.WorkPlanes.Item("Top Plane")
	oWorkPlane.SetFixed(PlanePoint(1), oAxisX, oAxisY)
	oWorkPlane.Grounded = True
Else
	oWorkPlane = oCompDef.WorkPlanes.AddFixed(PlanePoint(1), oAxisX, oAxisY, False)
	oWorkPlane.Grounded = True
	oWorkPlane.Name = "Top Plane"
End If

 Unfortunately this didn't pan out as this workflow is also causing constraints placed to these work features to be lost.  Constraints to World work features does hold true, fortunately.

 

I've attempted to create a copy of the part to be changed, made edits, and then used the component replace option in attempt to prevent the loss of these dynamic links, but that too fails to work and my dimensions & notations are still being lost on paper.

 

My theory is that each sketch entity and/or feature is given an address value within Inventor and this is used as the dynamic link to dimensions, notations, details & sections.

 

What's a workflow I can use that will allow me to make updates to a parts design and be able to keep the dynamic association all the way through to the drawing files.  Is the only path to first evaluate every sketch entity to modify that entity?  This workflow would be quite the nightmare considering all the variations in features and locations I would have to evaluate & handle; so I hope there's a better path forward than this.

Autodesk Inventor Certified Professional
0 Likes
117 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @llorden4.  Looking at the code you posted for redefining existing custom WorkPlanes, and hearing about that causing some problems made me think of a slightly alternate process you might be able to use there.  Instead of using WorkPlane.SetFixed method, have you considered getting the WorkPlane.Definition, then working with the methods to change it?  I can't remember if I have tried it that way, but I know that I looked into this idea at least once before.  The WorkPlane.Definition property is ReadOnly, but that just means that you can not set another definition as its value...it does not necessarily mean that you would not be able to make changes to the definition object itself.  There are several types of definition objects though, so I'm not sure if it would return an AssemblyWorkPlaneDef type object, a FixedWorkPlaneDef type, or some other type, but most seem to have the same GetData & PutData methods available.  Maybe if it will let you use that PutData method of its definition, it will preserve the constraints / dimensions downstream.  Just an untested thought.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)