Copy Ilogic Rules and Userparameters from One Drawing to Another drawing

Copy Ilogic Rules and Userparameters from One Drawing to Another drawing

sripandian
Enthusiast Enthusiast
858 Views
4 Replies
Message 1 of 5

Copy Ilogic Rules and Userparameters from One Drawing to Another drawing

sripandian
Enthusiast
Enthusiast

Hi,

I am trying to copying userparameters and ilogic rules from one drawing to another drawing in inventor 2017 using C#.net. I can get all parameters Name and Parameters Expression but I couldn't get Units. How to get Units of the Userparameter. i tried using API  Userparameter.get_units( ) and Userparameter.Set_units( ). 

 

Another issue in Copying Rules, While using AddRules the rule gets triggered automatically using Ilogic automation. I need solution in C#.Net.Kindly any expert help me in this regards.

 

Thanks and Regards,

Pandian.S

0 Likes
859 Views
4 Replies
Replies (4)
Message 2 of 5

AlexFielder
Advisor
Advisor

Hi @sripandian,

 

Are you able to share with us an example of the code that isn't working for you?

 

Without an example we may end up repeating some of the same code you have already created as well as the same problems.

 

In case you haven't seen it already, I posted here:

 

Searching the Online API help without having to remember the URL to it...

 

about being able to search the API from within Google Chrome's address bar; perhaps that might shed some light on what you are missing?

 

Thanks,

 

Alex.

0 Likes
Message 3 of 5

sripandian
Enthusiast
Enthusiast
Hi, here i will explain with my problem.. Userparameters param=dwgdoc.Parameters.Userparameter;
foreach(Userparameter eachparam in param)
{
String Paramname=eachparam.name;
String Paramexpression=eachparam.expression;
String ParamUnits = eachparam.get_units(); //i am getting error on this line

......
}

While using the eachparam.get_units() i got error that "e_member not found". Because of this I couldn't get units of the userparameter in drawing document.
Thanks and regards,
Sripandian
0 Likes
Message 4 of 5

MechMachineMan
Advisor
Advisor

Where does the "get_" come from? Shouldn't the call just be "userparm.units"?


--------------------------------------
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 5 of 5

sripandian
Enthusiast
Enthusiast
Hi, thanks for your reply..
In c# , .units doesn't exposed like Userparam.Name,Userparam.Expression... I am also having same doubt, why they didn't expose the unit property in Unitparameter class...
Thanks and regards,
sripandian
0 Likes