You are on page 1of 5

7/17/2015

InventorVBAEdgeDefinitionfor...AutodeskCommunity
DavidWHouse EditAccount Preferences SignOut

Help

Search the Community

SEARCH

Advanced Search

FORUMS

ARTICLES

Browse by product

IDEAS
Autodesk Community

Inventor

Inventor Customization

Inventor VBA Edge Definition for...

INVENTOR CUSTOMIZATION

REPLY

Message Listing

Topic Options

Previous Topic

Next Topic

Search This Board

Bill_Regan
Archived Account

3 Posts

Options

Inventor VBA Edge Definition for use in Assembly Constraints


603 Views, 3 Replies
11-18-2002 12:54 AM

SEARCH

I have been unable to define the proper format for collecting edges in a subroutine to be used for assembly constraints
in another routine. I understand how the Edge Collection works for fillets , but the method provided in the Help
Example does not provide a way to identify specific edges such as the upper and lower edges of pipes or conical
sections in tapered pipes that can be used for assembly constraints.
I tried to use a point on the edge to define the edge so that the edge could be added to the attribution collection set,
as shown below but the code with the ' in column one not allowed for edge objects.
Does know the proper VBA format to add edges to a collect set so that they can be used to define assembly constraints
in VBA?
Dim oTopFace As Face
Dim oBottomFace As Face
Set oTopFace = compdef.SurfaceBodies.Item(1).LocateUsingPoint(kFaceObject, oTG.CreatePoint(Dia - Thickness / 2,
Length, 0))
Set oBottomFace = oCompDef.SurfaceBodies.Item(1).LocateUsingPoint(kFaceObject, oTG.CreatePoint(Dia - Thickness /
2, 0, 0))
Dim oTopEdge As Edge
' Set oTopEdge = oCompDef.SurfaceBodies.Item(1).LocateUsingPoint(kFaceObject, oTG.CreatePoint(Dia, Length, 0))
Dim oAttribSet As AttributeSet
Set oAttribSet = oTopFace.AttributeSets.Add("TopFace")
Set oAttribSet = oBottomFace.AttributeSets.Add ("BottomFace")
Set oAttribSet = oTopEdge.AttributeSets.Add("TopEdge")

Post 1 of 4 | Share
Report Inappropriate
Content

Search Inventor Customization

Regards,
Bill Regan
Add Tag...

My Toolbox
Post to the Community
Have questions about Autodesk
products? Ask the community.
NEW POST

Recommendations
Inventor Assembly Constraint
Iss...
Inventor 2016 enumerating
outer ...
Identifying constraints in
brows...
Invenotr VBA

0 Kudos

http://forums.autodesk.com/t5/inventorcustomization/inventorvbaedgedefinitionforuseinassemblyconstraints/tdp/754842

REPLY

QUICK REPLY

Assembly problem - Angle


Constra...

1/5

7/17/2015

*Ekins, Brian

InventorVBAEdgeDefinitionfor...AutodeskCommunity

Re: Inventor VBA Edge Definition for use in Assembly Constraints

Options

11-18-2002 08:49 AM in reply to: Bill_Regan


Thisisoneofthetrickierissueswhenperforming
whatseemlikeeasytaskswiththeAPI.Ithinkagoodanalogyisflying
anairplane.Whenyou'reworkingwithInventorinteractivelyyou'reflying
bysight,havegoodweather,andexcellentvisibility.Cominginfora
landingyou'reabletovisuallylineupwiththerunwayandland.When
you'reusingtheAPI,it'slikeallofthewindowshavebeencoveredandyou
havetoflyexclusivelybyinstrument.Forexample,ifyouneedtheedge
thatrepresentstheedgeofaholeit'seasyfortheusertoselectit.
However,foryoutofinditblindlyusingtheAPIcansometimesbequitea
challenge.

Download & Installation


Autodesk Online Store Help
Getting your Software
Downloads & Upgrades
Serial Numbers & Product Keys
Installation & Licensing
Activation & Registration
Network License Administration

TheInventorAPIsupportsseveraldifferentwaysof
accessingspecifieditemsofthesolid.SolidsandsurfacesinInventor
arerepresentedbyaboundaryrepresentation(BRep).Thisisexposed
throughtheAPIasaSurfaceBodyobject.TheSurfaceBodyisthetoplevel
objectandrepresentstheentiresolid.Fromthesurfacebodyyoucan
accessthefaces,edges,andverticesofthesolid.Asolidismadeupof
asetofconnectedsurfaces.TheBRepiswhatdefineshowthesesurfaces
areconnected.UsingtheSurfaceBodydirectly,youcaniterateoverallof
thevariouspiecesoftheBRepandbylookingforspecificpropertiesofeach
itemfindaparticularBRepentity.Tohelpwiththisprocess,Inventor
supportssomeadditionalfunctionstohelpyoufindspecificitemseasier.
Forexample,foraspecificfeatureyoucangodirectlytothefacesthatwere
createdwhenthatfeaturewasplaced.Somefeaturesevencategorizethe
facesthatwerecreated.Forexample,fromanextrudefeatureyoucanget
justthetop,bottom,orsidefaces.TheAPIOverviewsectionforthe
BRepstillneedstobewrittenandI'llgointomuchmoredetailwithexamples
inthat.

Subscription Management
Sign In / Create Account
Maintenance Subscription Help
Desktop Subscription Help
Cloud Service Subscription FAQ

Onesampleyoumightwanttotakealookatthe
demonstrateswhatI'vejusttalkedaboutistheAutoBoltssample.Inthis
sample,edgesontheboltswerepreviouslyidentifiedusingattributes.
Theholesandedgesonthepartwheretheboltswillbeplacedarefound
dynamicallywhentheprogramisrunning.Youcanseehowitlooksthrough
theBRepentitiesforoneswithspecificproperties.Theexactprocess
willdifferfromcasetocasedependingonwhatyou'retryingto
accomplish.

Brian

style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGINRIGHT: 0px">
"Bill_Regan" <
href="mailto:bregan@datecinc.com">bregan@datecinc.com> wrote in message
href="news:f12467f.-1@WebX.maYIadrTaRb">news:f12467f.-1@WebX.maYIadrTaRb...
I
have been unable to define the proper format for collecting edges in a
http://forums.autodesk.com/t5/inventorcustomization/inventorvbaedgedefinitionforuseinassemblyconstraints/tdp/754842

2/5

7/17/2015

InventorVBAEdgeDefinitionfor...AutodeskCommunity

subroutine to be used for assembly constraints in another routine. I


understand how the Edge Collection works for fillets , but the method
provided in the Help Example does not provide a way to identify specific edges
such as the upper and lower edges of pipes or conical sections in tapered
pipes that can be used for assembly constraints.
I tried to use a point on the edge to define the edge so that the edge
could be added to the attribution collection set, as shown below but the code
with the ' in column one not allowed for edge objects.
Does know the proper VBA format to add edges to a collect set so that they
can be used to define assembly constraints in VBA?
Dim oTopFace As Face
Dim oBottomFace As Face
Set oTopFace =
compdef.SurfaceBodies.Item(1).LocateUsingPoint(kFaceObject,
oTG.CreatePoint(Dia - Thickness / 2, Length, 0))
Set oBottomFace =
oCompDef.SurfaceBodies.Item(1).LocateUsingPoint(kFaceObject,
oTG.CreatePoint(Dia - Thickness / 2, 0, 0))
Dim oTopEdge As Edge
' Set oTopEdge =
oCompDef.SurfaceBodies.Item(1).LocateUsingPoint(kFaceObject,
oTG.CreatePoint(Dia, Length, 0))
Dim oAttribSet As
AttributeSet
Set oAttribSet =
oTopFace.AttributeSets.Add("TopFace")
Set
oAttribSet = oBottomFace.AttributeSets.Add ("BottomFace")

Post 2 of 4 | Share
Report Inappropriate
Content

Bill_Regan
Archived Account

3 Posts

Set oAttribSet =
oTopEdge.AttributeSets.Add("TopEdge")
Regards,
Bill Regan
Add Tag...

0 Kudos

REPLY

QUICK REPLY

Options

Re:
11-22-2002 01:20 AM in reply to: Bill_Regan

Brian,
Thanks for directing me to the Autobolts VB code. However, in this code the edge must already be specified in the VB
selection set. What I am trying to acomplish is to add a unique cylinder edge to the selection set by specifying a point
on the edge, but I have not been able to locate the VBA command that provides this capability. Is this possible in the
current API?
Regards,
Bill

Post 3 of 4 | Share
Report Inappropriate
Content

Add Tag...

0 Kudos

http://forums.autodesk.com/t5/inventorcustomization/inventorvbaedgedefinitionforuseinassemblyconstraints/tdp/754842

REPLY

QUICK REPLY

3/5

7/17/2015

InventorVBAEdgeDefinitionfor...AutodeskCommunity

*Autodesk\

Options

Re:
11-22-2002 05:44 AM in reply to: Bill_Regan
Bill,

TheAutoBoltssampledemonstratestwothings.
Thefirstiswhatyousawanedgeisidentifiedinteractively(theselection
setinthis)case,taggedwithanattribute,andusedlater.Thisishow
theedgeontheboltisidentified.However,theedgeonthepartthatis
usedfortheotherhalfoftheinsertconstraintisidentifieddynamicallyby
examiningthemodelitself.TheGetHoleInfofunctioniswherethisworkis
beingperformed.TheAPIisquiterichwiththeabilitytotraverse
throughthemodelandquerythegeometry.AsImentionedbeforethereis
alsofunctionalityonfeaturestoprovidemoredirectaccesstothis
information.Inadditiontherearesomequerytypefunctionstoletyou
findgeometry.Addressingyourspecificexample,theLocateUsingPoint
methodontheSurfaceBodyobject,takesapointasinputandreturnsaface,
edge,orvertexthatiswithinagiventolerance.

Brian

style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGINRIGHT: 0px">
"Bill_Regan" <
href="mailto:bregan@datecinc.com">bregan@datecinc.com> wrote in message
href="news:f12467f.1@WebX.maYIadrTaRb">news:f12467f.1@WebX.maYIadrTaRb...
Brian,
Thanks for directing me to the Autobolts VB code. However, in this code
the edge must already be specified in the VB selection set. What I am trying
to acomplish is to add a unique cylinder edge to the selection set by
specifying a point on the edge, but I have not been able to locate the VBA
command that provides this capability. Is this possible in the current API?
Post 4 of 4 | Share

Regards,
Bill

Report Inappropriate
Content

Add Tag...

0 Kudos

Message Listing
Did you find this discussion helpful?

Yes

REPLY

QUICK REPLY

Previous Topic

Next Topic

No

http://forums.autodesk.com/t5/inventorcustomization/inventorvbaedgedefinitionforuseinassemblyconstraints/tdp/754842

4/5

7/17/2015

InventorVBAEdgeDefinitionfor...AutodeskCommunity

FOLLOW AUTODESK

PRODUCTS

HELP & SUPPORT

BUY

ABOUT AUTODESK

Facebook

3D CAD software

Customer Service

Online store

Careers

Twitter

Construction software

Documentation & knowledge base

Find a reseller

Contact us

YouTube

Drafting software

Installation

Subscription

Philanthropy

LinkedIn

Painting software

Product upgrades

Support offerings

Gallery

Student downloads

Service packs & updates

Education licensing

Investor relations

Design engineering

Training resources

Newsroom

Civil engineering

Blogs

Trust Center

PLM

Discussion groups

Autodesk Labs

All social

Character animation

Autodesk Research

Movie editing

Autodesk University

Visual effects

Privacy | Legal Notices & Trademarks | Report Noncompliance | Site map | Copyright 2014 Autodesk Inc. All rights reserved

http://forums.autodesk.com/t5/inventorcustomization/inventorvbaedgedefinitionforuseinassemblyconstraints/tdp/754842

Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike
3.0 Unported License. Please see the Autodesk Creative Commons FAQ for more information.

5/5

You might also like