Create Origin Indicator

Create Origin Indicator

sundaram1087
Advocate Advocate
543 Views
1 Reply
Message 1 of 2

Create Origin Indicator

sundaram1087
Advocate
Advocate

Hi

 

I have work point attached with Part, By which i created the Center Mark in Drawing using Add by Feature method. And then i have crated the Geometry intent .By using intent i try to create the Origin indicator.    Am Getting issue while creating the origin indicator. Please find the following code 

 

CurrSheet = DrawingDoc.Sheets(CurrSheetNo)

CurrView = CurrSheet.DrawingViews.Item(1)

Dim CurrAssyDoc As AssemblyDocument = CurrView.ReferencedDocumentDescriptor.ReferencedDocument
Dim CurrCompOcc As ComponentOccurrence = CurrAssyDoc.ComponentDefinition.Occurrences.Item(1)

point1 = CurrCompOccP.Definition.WorkPoints.Item("WP_T")
CurrCompOccP.CreateGeometryProxy(Opoint1, Opoint1Proxy)
CurrCenMark = CurrSheet.Centermarks.AddByWorkFeature(Opoint1Proxy, CurrView)
OriginIndGeoIntent = CurrSheet.CreateGeometryIntent(CurrCenMark, IntentTypeEnum.kPointEnumIntent)
CurrView.CreateOriginIndicator(OriginIndGeoIntent)

 

Please suggest is there any error or is there any alternative method available

 

Thanks

Shunmugasundaram

 

 

 

 

 

Pelase

0 Likes
544 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

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

EESignature

(Not an Autodesk Employee)

0 Likes