ILogic vs API Model Property access via Drawing

ILogic vs API Model Property access via Drawing

kmiller
Collaborator Collaborator
1,044 Views
2 Replies
Message 1 of 3

ILogic vs API Model Property access via Drawing

kmiller
Collaborator
Collaborator

I have done some searching and will continue to look, but is there an easy way to get this illogic code to work in .net addin?  I have having a trouble finding a way to easily pull the model information of the drawing document and setting my ipropery value (in my drawing) to use the "DocName, iprop set name, iprop name" arguments.

- Partial I Logic code below - 
 
 'Exit rule if no part or assembly is in the drawing yet.
 If (ThisDrawing.ModelDocument Is Nothing) Then
   Return
  Else
   'Get the filename of the doc the drawing points to
   modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName) 
    iProperties.Value("Custom", "InvTic_ActPcSqFt") = iProperties.Value(modelName, "Custom", "Tic_ActualSqFt")
  End If
  

I can't find in the API where I can grab the Drawing.ModelDocument and be able to use that document to set the value to the iproperties.  I guess I am wondering if these methods are even available in the API or if they are only iLogic specific and/or if they are in the API where can I find them?

 

Otherwise it looked like there where some other posts I could try in regards to the drawing views. 

The other option I had was just to keep our illogic code and potentially call that from my addin.  However, if I just build it into my addin, then we wouldn't need the illogic portion of it. 

-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes
Accepted solutions (1)
1,045 Views
2 Replies
Replies (2)
Message 2 of 3

MechMachineMan
Advisor
Advisor
Accepted solution

The model document command through iLogic is the "same" as either of the 2 cases (not sure which)

- Grabbing the first REFERENCED DOCUMENT of the .idw

- Grabbing the first REFERENCED DOCUMENT of the first drawing view in the document

 

There are many, many samples, and the documentation does exist in the online programming help.


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 3

kmiller
Collaborator
Collaborator
Perfect. Thanks for the tip.


-------------------------------------------------------------------------------------------------

If this response answers your question please click "Accept as Solution".
0 Likes