Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

programming snippets, ilogic - measure.extentsLength

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
2820 Views, 4 Replies

programming snippets, ilogic - measure.extentsLength

Hi, I am a programmer and im trying to use the 'Measure.ExtentsLength', 'Measure.ExtentsHeight' & 'Measure.ExtentsWidth' found in the snippets which inventors ilogic offers.

 

a (correct/working) rule that i currently have working in a part document is:

 

Dim Length As Integer = 0
Dim Height As Integer = 0
Dim Width As Integer = 0

Length = Measure.ExtentsLength
Height = Measure.ExtentsHeight
Width = Measure.ExtentsWidth

 

however when i am programming in vb.net/c++ my code is:

 

 

Dim InvApp As Inventor.Application

Dim PartDoc As InvApp.PartDocument = "filepath of part"

MsgBox(PartDoc.Measure.ExtentsLength) '<---------error

 

 

what are the librarys/headers that I have to declare find the Measure.ExtentsLength?

 

Thanks in advance, Craig

 

 

 

 

 

 

 

 

4 REPLIES 4
Message 2 of 5
jletcher
in reply to: Anonymous

What are you trying to do there is very little on ilogic be better if you tell use what you are trying to do.

Message 3 of 5
Anonymous
in reply to: jletcher

My program will create a drawing from any part. Below is the complete - working ilogic rule, that i am trying to translate over to my stand-alone program.

 

Imports Inventor.ViewOrientationTypeEnum
Imports Inventor.DrawingViewStyleEnum

' UPDATE PROPERTIES'
iLogicVb.RunRule("Update Properties")


'END UPDATE PROPERTIES'
Dim oDrawDoc as DrawingDocument    
Dim oPartDoc as Document
Dim oSheet As sheet
Dim oTG As TransientGeometry
Dim oBaseView As DrawingView
Dim oView2 as DrawingView
Dim oView3 as DrawingView
Dim oView4 as DrawingView

iLogicVb.RunRule("CalcMaxValues")

Dim DScaleSize = 150

Dim ViewScale = DScaleSize / MaxMax

Dim Scale20 = (ViewScale/100)*20
Dim IsoScale = ViewScale-Scale20

    oPartDoc = ThisDoc.Document  
    
    'Define IDW Template File Location    oDrawDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "R:\Drawing Library\INVENTOR\Templates\Craig Templates\IDW PART.idw", True)
    oSheet = oDrawDoc.Sheets.Item(1) 
    
    'Define 2d view bottom left corner points for four views - sets the location to place the views (x,y) coordinates    oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(10, 14)
    oPoint2 = ThisApplication.TransientGeometry.CreatePoint2d(10, 30)
    oPoint3 = ThisApplication.TransientGeometry.CreatePoint2d(35, 14)
    oPoint4 = ThisApplication.TransientGeometry.CreatePoint2d(50, 32)
    
    oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, ViewScale,kFrontViewOrientation, kHiddenLineDrawingViewStyle, "Default")
    
    oView2 = oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint2, kHiddenLineDrawingViewStyle, ViewScale)
    oView3 = oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint3, kHiddenLineDrawingViewStyle, ViewScale)
    oView4 = oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint4, kHiddenLineDrawingViewStyle, IsoScale)
    
                'get the path and file name of the selected item                Dim CurFileName = ThisDoc.ModelDocument.FullFileName                
                
                'find the postion Of the last backslash In the path                Dim FNamePos = InStrRev(CurFileName, "\", -1)   
                'get the file name with the file extension                Dim Name = Right(CurFileName, Len(CurFileName) - FNamePos)
                'get the file name (without extension)                Dim ShortName = Left(Name, Len(Name) - 4)
                'get the path of the folder containing the file                Dim Folder_Location = Left(CurFileName, Len(CurFileName) - Len(Name))
                                            
                Dim strFolder As String = Folder_Location & iProperties.Value("Summary", "Title")
                                
                'ThisDoc.Document.SaveAs(strFolder & (".dwg") , True)    
'****************************    
    
    oDrawDoc.SaveAs(strFolder & ".idw" , False)
    oDrawDoc.Close(False)
    DrawingDoc = ThisApplication.Documents.Open(strFolder & ".idw" , True)

 

the problem i am having is that because my program is seperate, it can't find where the Measure.ExtentsLEngth is stored. eg/ Inventor.MeasureTools.Measure.ExtentsLength

 

I need to know where the function for measuring the extents are.

 

 

 

 

 

 

Message 4 of 5
Curtis_Waguespack
in reply to: Anonymous

Hi craigzcool,

This thread might help:

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Extents-of-parts/m-p/1869988

 

Keep in mind you'll likely find better search results on the customization forum for programming questions:

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 5 of 5
jletcher
in reply to: Anonymous

Well Curtis is alot better at this then I am so I will let him lead you from here. Smiley Happy

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report