Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ilogic and LDAP

2 REPLIES 2
Reply
Message 1 of 3
h.schkorwaga
277 Views, 2 Replies

ilogic and LDAP

Hello everybody!

 

First of all I'm new to ilogic - OK not completely new - I tried some snippets and if you want to make common things you have a easy solution.

 

Now i want to convert my VBA auto-macro to ilogic/VB.net code to create a rule. In the VBA-Code I made a query to LDAP to pull aut the department the current logged in user belongs to.

 

How do I achive this with ilogic?

 

here is my VBA-code which works:

 

Private Function CheckUser() As String
 
On Error Resume Next
Dim qQuery, objSysInfo, objuser
Dim Department

Set objSysInfo = CreateObject("ADSystemInfo")
objSysInfo.RefreshSchemaCache
qQuery = "LDAP://" & objSysInfo.UserName
Set objuser = GetObject(qQuery)

Department = objuser.Department

Select Case Department
    Case {Case1}
CheckUser = TitleBlockLAG Case {Case2}
CheckUser = TitleBlockLT Case Else CheckUser = TitleBlockLAG End Select End Function

 

 

Thank you in advance!

 

Greetings,

Hel

2 REPLIES 2
Message 2 of 3
Gruff
in reply to: h.schkorwaga

The way you are declaring qQuery, objSysInfo, objuser, and department
results in them being variants in VB.

Under VB.NET and I assume iLogic you would need to declare them as type Object instead.
Message 3 of 3
h.schkorwaga
in reply to: h.schkorwaga

Hello,

 

thank you for your reply - unfortunately I'm new to VB.NET and ilogic and the Problem is that we need this piece of Code in a short time because we're going to update to INV2014 next week. In this short time an due to the fact that much other work is on my desk I can't learn VB.NET as fast as i should. 😞

I searched round and found some snippets concerning LDAP but with ilogic they all produced many errors...

 

I hope someone can help me to modify the code to get it to work with ilogic.

 

Many thanks,

hel

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

Post to forums  

Autodesk Design & Make Report