Is VBA within Civil3D as flexible and supportive as VB.NET/C#.NET?

Is VBA within Civil3D as flexible and supportive as VB.NET/C#.NET?

Anonymous
Not applicable
647 Views
5 Replies
Message 1 of 6

Is VBA within Civil3D as flexible and supportive as VB.NET/C#.NET?

Anonymous
Not applicable

Hello All,

 

Can we access APIs using default VBA in Civil3D?
For eg: Can we create a 3D polyline using a set of vertices (from excel) using VBA?

or Can we create Pressure Network using VBA? or Can we add fitting to a network?

I am trying to create a macro to automate adding Fitting to a network. Through C#.Net, APIs are limited for pressure network. Record option within C3D gives me a .actm which I cant read in VBA. Can I use VBA for such automated workflows?

 

Thanks in advance.

 

0 Likes
648 Views
5 Replies
Replies (5)
Message 2 of 6

Jeff_M
Consultant
Consultant

With VBA you can create/edit all AutoCAD objects and some C3D objects. But, since VBA uses the COM API, you cannot do anything in regards to Pressure Networks as there is no COM API for those objects

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi @Jeff_M ,

 

Thank you for your reply. 

 

Okay in that case, if I have to record a macro of adding a fitting (invoking the native functionality) , then only way is "Record" option which creates a .actm file?

 

Also when reading the .actm file, it is all in binary. Anyway to read it in vba or any other usable format?

0 Likes
Message 4 of 6

Jeff_M
Consultant
Consultant
I've never used the Record macro tool, so have no experience with it.
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 5 of 6

Anonymous
Not applicable

Okay no problem.

@Jeff_M , is autolisp also based on COM API? 
Can I do the manual task of adding pressure fitting or any pressure network related task using LISP?

0 Likes
Message 6 of 6

Jeff_M
Consultant
Consultant
Yes, lisp uses the COM API to access the Civil 3D objects. You may be able to use (command "xxxx" params) but, based on everything else related to the PressurePipes, I wouldn't be surprised if there are no commandline only (i.e no dialogs) commands.
Jeff_M, also a frequent Swamper
EESignature
0 Likes