It is currently Sat May 18, 2013 6:32 pm

All times are UTC





Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Oct 20, 2010 11:45 pm 
Offline
MCAD Lurker

Joined: 20 Oct 2010
Posts: 2
Country: Canada
State: British Columbia
CAD System: Inventor
I am currently working with iLOGIC and the API to try and get dimensions to measure and output directly to a BOM.

I am working with the following exported inventor user parameters that the BOM will look for:
output_D (for Depth)
output_W (for Width)
output_L (for Lenth)

inside the IPT files, an Ilogic rule set to the event trigger 'BeforeSaveDocument':

========
'save the AllWorkFeatures status to reset once run
AWF = (ThisApplication.activedocument.ObjectVisibility.AllWorkFeatures)
ThisDoc.Document.ObjectVisibility.AllWorkFeatures = (False)
'save the ConstructionSurfaces status to reset once run
CSURF = (ThisApplication.activedocument.ObjectVisibility.ConstructionSurfaces)
ThisDoc.Document.ObjectVisibility.ConstructionSurfaces = (False)

'get max dimension
Dim i As String
i = MaxOfMany(Measure.ExtentsLength, Measure.ExtentsWidth, Measure.ExtentsHeight)
'get min dimension
Dim j As String
j = MinOfMany(Measure.ExtentsLength, Measure.ExtentsWidth, Measure.ExtentsHeight)
'set max and min to output parameters
Parameter("output_L") = i
Parameter("output_W") = j
'get the remaining dimension
Dim k As String
k = Measure.ExtentsLength + Measure.ExtentsWidth + Measure.ExtentsHeight - i - j
'set the remaining dimension
Parameter("output_D") = k

'reset the AllWorkFeatures/ConstructionSurfaces statuses... statusii?
ThisDoc.Document.ObjectVisibility.AllWorkFeatures = (AWF)
ThisDoc.Document.ObjectVisibility.ConstructionSurfaces = (CSURF)
==========

I have a very similar rule being triggered inside the Assembly files also. The issue I am running into is that if the assembly file contains a part that has a construction surface that is visible inside it, the values for the extents of the assembly return the extents of that surface instead of the solids only. As you can see I have suspended the visability for the constructionsurfaces inside the IPT files while writing the values to the parameters but I reset them to as they were before so as to not interupt the user. This means I must also accomplish this goal in the IAM files too.

How do I control the visibility of the 'ConstructionSurfaces' inside the assembly?

Thanks in advance.
TomPy


Share on FacebookShare on TwitterShare on DiggShare on DeliciousShare on TumblrShare on Google+
Top
 Profile  
 
PostPosted: Wed Oct 20, 2010 11:51 pm 
Offline
MCAD Lurker

Joined: 20 Oct 2010
Posts: 2
Country: Canada
State: British Columbia
CAD System: Inventor
Error code generated


===============
ilogic event-driven rule
===============

===============
error message
===============
iLogic Event-Driven Rule

Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

==============
more info
==============
System.Runtime.InteropServices.COMException (0x80020003): Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))
at Microsoft.VisualBasic.CompilerServices.LateBinding.LateGet(Object o, Type objType, String name, Object[] args, String[] paramnames, Boolean[] CopyBack)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at p.b(String A_0)
at p.ar()
at bd.a()
at ao.b(aj A_0)
at ao.a(aj A_0)
at br.a(bz A_0, Document A_1)
at bt.a(String A_0, NameValueMap A_1)
at bt.b(String A_0)
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at p.b(String A_0)
at p.ar()
at bd.a()
at ao.b(aj A_0)
at ao.a(aj A_0)
at br.a(bz A_0, Document A_1)
at bt.a(String A_0, NameValueMap A_1)
at h.a(Document A_0, StandardAddInServer A_1, InventorEventCode A_2)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
POWERED_BY