Inventor Engineer-to-Order

Reply
Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 1 of 16 (451 Views)

Find view object on the drawing through API.

451 Views, 15 Replies
06-22-2012 09:00 AM

I wanna create the ordinate dimansion on the drawing.

 

Add(Intent As GeometryIntent, TextOrigin As Point2d, DimensionType As DimensionTypeEnum, ByRef DimensionStyle As [optional] VARIANT, ByRef Layer As [optional] VARIANT, Result As [out, retval] OrdinateDimension*)

How I can define GeometryIntent for function that was specified above.

All examples at the Inventor API Help is based on selection objects manually.

I wanna create the ordinate dimasions automatically. For this I need find/define the edge on the drawing view.

Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.
Employee
AlexKorzun
Posts: 109
Registered: ‎11-10-2008
Message 2 of 16 (436 Views)

Re: Find view object on the drawing through API.

06-25-2012 05:37 AM in reply to: Lesoux

Hi,

 

Indexer Property DrawingView.DrawingCurves may help you get the drawing curves enumerator that corresponds to the particular edge.

 

 

 

Thank you,



Alex Korzun
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 3 of 16 (427 Views)

Re: Find view object on the drawing through API.

06-25-2012 12:14 PM in reply to: AlexKorzun

Dim oInvApp As Any = %%InventorApplication
Dim oDrawDoc As Any = oInvApp.ActiveDocument
Dim oSheet As Any = oDrawDoc.ActiveSheet
Dim oDrawViews As Any = oSheet.DrawingViews
Dim oDrawView As Any = oDrawViews.get_Item(1)
Dim oDrawingCurve As Any = oDrawView.DrawingCurves.get_Item(1)

 

Source code doesn't compile. I have the error message (see attached picture)

Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.
Employee
AlexKorzun
Posts: 109
Registered: ‎11-10-2008
Message 4 of 16 (411 Views)

Re: Find view object on the drawing through API.

06-26-2012 07:15 AM in reply to: Lesoux

Hi,

 

The DrawingCurves is the indexer property, Having the following Rule for finding the View (and the ISO view of the block+cone in it):

 

Rule FindView As Any
	Dim oInvApp As Any = %%InventorApplication
	Dim oDrawDoc As Any = oInvApp.ActiveDocument
	Dim oSheet As Any = oDrawDoc.ActiveSheet
	Dim oDrawViews As Any = oSheet.DrawingViews
	Dim oDrawView As Any = oDrawViews.get_Item(1)
	Return oDrawView
End Rule

 you may access:

 

1) All curves:

Intent >FindView.get_DrawingCurves().Count
--> 13

2) Specific occurrence ( should use GetHostObject())

Intent >FindView.get_DrawingCurves(GetHostObject(ivBlock_1)).Count
--> 9

 

 

 

 

 


Thank you,



Alex Korzun
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 5 of 16 (408 Views)

Re: Find view object on the drawing through API.

06-26-2012 07:33 AM in reply to: AlexKorzun

Perfect, everything is Okay! Thanks for reply.

Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.
Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 6 of 16 (406 Views)

Re: Find view object on the drawing through API.

06-26-2012 08:22 AM in reply to: AlexKorzun

When I tried to use GetHostObject() I got the error message (see attached picture). Do you know why?

 

{code}

Return InsertOrdinateDimension.get_DrawingCurves(GetHostObject(last(partObjectToDetail.assyChild))).Count

{code}

 

This is my Child on the Sheet

 

Child sheetChild As :myView
model = partObjectToDetail
...

{code}

...
End Child

 

<partObjectToDetail> is assembly that has next code:

 

Child assyChild As :myAdoptPart, Quantity = myQty

...
{code}

...
End Child


Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.
Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 7 of 16 (410 Views)

Re: Find view object on the drawing through API.

06-26-2012 08:23 AM in reply to: Lesoux

Sorry, forgot about picture.

Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.
Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 8 of 16 (403 Views)

Re: Find view object on the drawing through API.

06-26-2012 10:41 AM in reply to: AlexKorzun

The last questions.
Can I define DrawingCurve through API using names of edges from "Entity Naming Editor"? I don't know definitely indexes of curves on the drawing. I know just the names of edges.

 

Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.
Employee
AlexKorzun
Posts: 109
Registered: ‎11-10-2008
Message 9 of 16 (401 Views)

Re: Find view object on the drawing through API.

06-26-2012 10:45 AM in reply to: Lesoux

Hi,

 

Please have a look at the topic that discusses how faces store Intent attributes. The edges and vertices have the similar mechanism.

 

 

Thank you,



Alex Korzun
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Distinguished Contributor
Lesoux
Posts: 149
Registered: ‎03-12-2012
Message 10 of 16 (398 Views)

Re: Find view object on the drawing through API.

06-26-2012 11:44 AM in reply to: AlexKorzun

Thanks. Should work.

Win7 x64
Xeon X5647
24 Gb RAM
Quadro FX 6000

Inventor 2013
ETO 6.1, Build 140.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube