Is this a local or external iLogic rule?
Is this the whole rule, or just a portion of the rule's code?
Is this just a concept code, and not the real code you're using?
- In the first line, I'm not seeing where you've defined "DrawingDoc".
- There should be a line before this that is something like "Dim DrawingDoc As DrawingDocument = ThisDrawing.Document"
- In the first line, I'm not seeing where "CurrSheetNo" is defined.
- Perhaps "DrawingDoc.ActiveSheet" would work better than "DrawingDoc.Sheets(CurrSheetNo)"
- On line 5, (defining point1) I noticed you started including the letter "P" in the ComponentOccurrence variable name. This seems like a typing mistake, since it wasn't there initially (in the previous line where it was defined).
- That altered variable name with the "P" is also used in the next line (line 6).
- Also, in line 6, I think the variable name for the point changed from "point1" to "Opoint1" by mistake.
- Also in line 6, the work point proxy variable needs to be created before it's value is set by this creation sub.
Try this:
Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oSheet As Sheet = oDDoc.ActiveSheet
Dim oView As DrawingView = oSheet.DrawingViews.Item(1)
Dim oADoc As AssemblyDocument = oView.ReferencedDocumentDescriptor.ReferencedDocument
Dim oOcc As ComponentOccurrence = oADoc.ComponentDefinition.Occurrences.Item(1)
Dim oWPoint As WorkPoint = oOcc.Definition.WorkPoints.Item("WP_T")
Dim oWPointProxy As WorkPointProxy
oOcc.CreateGeometryProxy(oWPoint,oWPointProxy)
Dim oCM As Centermark = oSheet.Centermarks.AddByWorkFeature(oWPointProxy, oView)
Dim oIntent As GeometryIntent = oSheet.CreateGeometryIntent(oCM, oCM.Position)
oView.CreateOriginIndicator(oIntent)
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE" 👍.
Also, when you have time, please review & vote for these 'Ideas' I'd like to get implemented.
- Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
- Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
- Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
- Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
- Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
- SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here
- Create DocumentSubTypeEnum Click Here
- Add kRevisionTag or kDrawingRevisionTag to ObjectTypeEnum Click Here
Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield

(Not an Autodesk Employee)