How to make my own vla or vlax functions ( for Autocad advance steel) from the interop dll files?

How to make my own vla or vlax functions ( for Autocad advance steel) from the interop dll files?

SanjoyNath
Advocate Advocate
3,278 Views
12 Replies
Message 1 of 13

How to make my own vla or vlax functions ( for Autocad advance steel) from the interop dll files?

SanjoyNath
Advocate
Advocate

Dear experts,

 

Since Advance steel forum has less number of lisp specialists , we cannot expect more experts there

We successfully do several inhouse developments with dot net in advance steel but closing and opening of advance steel and to get the profiles mapping with settings mapping done every time to test a simple change is too much critical , we like to do the lisp customization on advance steel. Advance steel dont have any bla , vlax things inbuilt. I think they have not given any ready api for lisp in advance steel. But Advance steel runs on FULL VERSION OF AUTOCAD. there are several dll files which are called from the ms office to create objects on advance steel through the vba but these dont work from the Autocads VBA. I dont know why Autodesk is not giving proper tlb for Advance steel.

 

We want to get the

interop dll to tlb

tlb to vla/vlax

then call these from the lisp

Attached references to clarify the roads map)

 

 

We know that we can prepare lisp functions from the tlb files , and we can prepare tlb files for interop dll files (com visible dll files)

 

For Advance Steel we can do lot of things with excel automations through the referencing of dll and tlb files in 32 bit excel.  Lisp is better since we dont need to close advance steel to test and deploy the lisp tools

For references of the process (i have attached the word files here) and some url relevant for this purpose

Here we have dot net dll files which we frequently use in    our inhouse Addins and Addons of Dotnet.

 

 

We want to generate .tlb from these 

we want to generate vla and the vlax files from these

Please help

 

 

C:\Program Files\Common Files\Autodesk Shared\Advance\

AdvanceExchangeModel16_64.dll
AdvanceExchangeModel21_64.dll
AdvanceExportsCOM21_64.dll
AdvanceGTCCIS221_64.dll
AdvanceGTCDispatcher16_64.dll
AdvanceGTCExpress21_64.dll
AdvanceGTCGeometry16_64.dll
AdvanceGTCGeometry21_64.dll
AdvanceGTCInterface16.dll
AdvanceGTCInterface21.dll
AdvanceGTCMapping16_64.dll
AdvanceGTCMapping21_64.dll
AdvanceGTCODBC16_64.dll
AdvanceGTCODBC21_64.dll
AdvanceGTCODBCBase16_64.dll
AdvanceGTCODBCBase21_64.dll
AdvanceGTCProfiles16_64.dll
AdvanceGTCProfiles21_64.dll
AdvanceGTCProfilesBase16_64.dll
AdvanceGTCProfilesBase21_64.dll
AdvanceGTCRoots16_64.dll
AdvanceGTCRoots21_64.dll
AdvanceGTCSDNF21_64.dll
AdvanceGTCStep21_64.dll
AdvanceRTFEngine16_64.dll
AdvanceRTFEngine21_64.dll
AdvanceSyncGTC16_64.dll
AdvanceSyncGTC21_64.dll
AdvanceSyncGTCUI16.dll
AdvanceSyncGTCUI21.dll
AdvanceTools16_64.dll
AdvanceTools21_64.dll
Interop.ADVANCEEXCHANGEMODELLib21.dll
Interop.AdvanceExportsCOMLib21.dll
Interop.AdvanceGTCMappingLib21.dll
Interop.AdvanceSyncGTCLib21.dll

 

https://docs.microsoft.com/en-us/dotnet/framework/interop/how-to-add-references-to-type-libraries

C:\ProgramData\Autodesk\Advance Steel 2021\USA\Steel\Support\Toolbars      dll files

 

SanjoyNath_0-1619095215070.png

 

 

 

 

 

How to make my own vla or vlax functions for advance steel from the interop dll files?

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Accepted solutions (1)
3,279 Views
12 Replies
Replies (12)
Message 2 of 13

dbroad
Mentor
Mentor

I'm not sure that you should use either the vla or vlax prefixes since they were proprietary to Autodesk.  Make up your own prefixes for advance steel such as AVS-.  It's been a while since I've done this but there are several functions that may be able to be used to build a library of lisp functions to access your product.

 

Sounds like you want to use the following to build your functions

(vlax-import-type-library :tlb-filename filename [:methods-prefix mprefix  :properties-prefix pprefix :constants-prefix cprefix])

If you decide not to go the type library route, you should  still be able to access your application with either

vla-GetInterfaceObject

vlax-get-or-create-object

 

Using vba to look a the exposed properties and methods seems like a good way to start.  You can use vlax-get, vlax-put, and vlax-invoke with those objects to interact with those objects since there are no built-in functions

Architect, Registered NC, VA, SC, & GA.
Message 3 of 13

dbroad
Mentor
Mentor

Just to add several items to consider:

  • Often, importing the whole type library is overkill, especially if you just want to do a few things.
  • type libraries usually use the .OLB file extension, not .DLL file extensions.  An exception is that Microsoft uses the .EXE file instead.  For example, this works on my computer to import the excel type libraries into AutoCAD:
  • (vlax-import-type-library :tlb-filename "C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\EXCEL.EXE" :methods-prefix "xlm-" :properties-prefix  "xlp-" :constants-prefix "mlc-")
Architect, Registered NC, VA, SC, & GA.
Message 4 of 13

SanjoyNath
Advocate
Advocate

Dear Experts,

Dear respected @Anonymous  Thank you very much

 

 

I have tried to use your technic.

 

And also a try to copy something from the AcadInfo.lsp

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun acet-acadinfo-check-typelib ( fh / fna key1 key2)
(setq key1 "HKEY_CLASSES_ROOT\\TypeLib\\{C094C1E2-57C6-11d2-85E3-080009A0C626}\\1.1\\0\\win32"
key2 "HKEY_CLASSES_ROOT\\TypeLib\\{C094C1E2-57C6-11d2-85E3-080009A0C626}\\1.1\\9\\win32"
key1 (vl-registry-read key1)
key2 (vl-registry-read key2)
);setq

 

 

 

 

 

I have seen that

For Revit to Advance Steel Interop  (And i use this dll for dot net programs references)

 

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\0639C0E7260E81540AF118577DD31C20]
"0A4B643700020150000007C5D0680240"="C:\\Program Files\\Autodesk\\Revit 2020\\AddIns\\SteelConnections\\Interop.AstSTEELAUTOMATIONLib5.dll"

 

 

Windows Registry Editor Version 5.00

I have successfully used these for numbering handling and for other purposes for dot net plugins/addons

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\482973DF26016EA4FA92B9686C17D3F9]
"FEE98B82620300001020FCF3A3907BD7"="C:\\Program Files\\Autodesk\\AutoCAD 2020\\ADVS\\Interop.AstSTEELAUTOMATIONLib5.dll"

 

 

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\92DD58A61498B5842A5E9FD44CA155D4]
"FEE98B82621400001020FCF3A3907BD7"="C:\\Program Files\\Autodesk\\AutoCAD 2021\\ADVS\\Interop.AstSTEELAUTOMATIONLib5.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components\92DD58A61498B5842A5E9FD44CA155D4\FEE98B82621400001020FCF3A3907BD7]
"PatchGUID"=""
"MediaCabinet"=""
"File"="Interop.AstSTEELAUTOMATIONLib5.dll"
"ComponentVersion"="25.0.611.0"
"ProductVersion"="25.0.611"
"PatchSize"="0"
"PatchAttributes"="0"
"PatchSequence"="0"
"SharedComponent"="0"
"IsFullFile"="0"

 

 

 

Now i am trying (my boss strictly wants) to use these (interop dll or tlb) for lisp coding for Advance Steel drawings editing and also for modeling smart objects , large plated objects to import data from Meshlabs and also from MathMod surfaces to plated objects in Advance steel through lisp

 

 

This below style is refered as in AcadInfo.lisp 

C:\Program Files\Autodesk\AutoCAD 2020\Support\acadinfo.lsp

(Is there any way to directly refe the Interop dll files from the lisp routines) ?

 

 

 


(cond
((not key1)
(write-line "Cannot open registry key 0 for AcAx23enu.tlb check" fh)
)
((not key2)
(write-line "Cannot open registry key 9 for AcAx23enu.tlb check" fh)
)
((not (findfile key1))
(write-line (strcat "Cannot locate '" key1 "'.") fh)
)
((not (findfile key2))
(write-line (strcat "Cannot locate '" key2 "'.") fh)
)
(T
(write-line "'AcAx23enu.tlb' file located." fh)
)
)
);defun acet-acadinfo-check-typelib

 

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Message 5 of 13

SanjoyNath
Advocate
Advocate

Dear Experts,

Dear @Anonymous 

 

I want to test the properties , functions and the constants of Advance steeel Automations tlb 

from the Advance steels objects now

 

 

I have not yet successful to register the  tlb or olb file for advance steel        (I tried to attach the latest tlb file we have got with Advance Steel such that you can test) but that denies attaching here

SanjoyNath_1-1619111704969.png

This is showing True here(Now i want to test the functions with asm-   , asc-   

I used the command for Advance Steel tlb files 

 

C:\Program Files\Autodesk\AutoCAD 2021\ADVS\AstorMain5.tlb

(vlax-import-type-library :tlb-filename "C:\\Program Files\\Autodesk\\AutoCAD 2021\\ADVS\\AstorMain5.tlb" :methods-prefix "asm-" :properties-prefix "asg-" :constants-prefix "asc-")

 

 

 

 

 

 

 

 

 

 

(Partial success to register vb6 olb here)

Thank you (i have registered the vb6 olb file but now want to access its methods in lisp)

This is Showing True here

SanjoyNath_0-1619109976543.png

 

 

 

 

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Message 6 of 13

dbroad
Mentor
Mentor
Accepted solution

In AutoCAD, issue the vlide command.  In vlide, use the appropos window.  Search by prefix for vbm-.  It should give you a list of the methods that were imported. Likewise, the same for properties and constants.  You will need to get help from the advance steel application to correctly identify the number and type of arguments that each function requires.  Using the VBAIDE might help as the methods and properties would be the same.

 

BTW: In general, DLL files cannot be used as type libraries.

 

Again, I reiterate, use prefixes that relate to your application or to the type library itself.  VB is typically used to represent Visual Basic.  If you're trying to work with Advancesteel, I would suggest AVSM-, AVSP-, and AVSC- as logical prefixes.

 

Please note also that LISP is a single document language.  You will need to import the type library whenever you open a drawing that needs to use Advance Steel capabilities. (none of which I am familiar with).

Architect, Registered NC, VA, SC, & GA.
Message 7 of 13

SanjoyNath
Advocate
Advocate

Thank you very much @dbroad 

I will use these functions from the Advance Steel

For the Current situation it is the Accepted Solutions

 

 

For every time for every files we will use these at the starting

 

(vlax-import-type-library :tlb-filename "C:\\Program Files\\Autodesk\\AutoCAD 2021\\ADVS\\AstorMain5.tlb" :methods-prefix "asm-" :properties-prefix "asg-" :constants-prefix "asc-")
T

 

660  Objects found  for asm types that is advance steel methods

 

SanjoyNath_0-1619126607903.png

 

 

 

660 types of Advance Steel constants are found

 

SanjoyNath_1-1619126777450.png

 

760 asg types found

 

SanjoyNath_2-1619126889354.png

 

 

 

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Message 8 of 13

SanjoyNath
Advocate
Advocate

Thank you very much Respected @dbroad 

 

Dear Experts,

 

I will like to use the below technics for converting dll files to tlb

Then tlb to the  Lisp calling

 

https://docs.microsoft.com/en-us/dotnet/framework/tools/tlbexp-exe-type-library-exporter

 

 

 

https://opdhsblobprod02.blob.core.windows.net/contents/c6aea4f5457448ee818b7292ba695982/2ff2c9a9a109...

 

SanjoyNath_0-1619131170996.png

 

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Message 9 of 13

dbroad
Mentor
Mentor

Thanks. I didn't know you could generate a tlb file from a dll.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 10 of 13

SanjoyNath
Advocate
Advocate

Dear Respected  @dbroad 

I am trying

I think I am surely doing some mistake

 

C:\Windows\System32>TlbExp "C:\Program Files\Common Files\Autodesk Shared\Advance\Interop.ADVANCEEXCHANGEMODELLib21.dll" /out:d:\Interop.ADVANCEEXCHANGEMODELLib21.tlb
Microsoft (R) .NET Framework Assembly to Type Library Converter 4.6.1055.0
Copyright (C) Microsoft Corporation. All rights reserved.

 

 

It is showing some error

 

TlbExp : error TX0000 : CLR assembly 'C:\Program Files\Common Files\Autodesk Shared\Advance\Interop.ADVANCEEXCHANGEMODELLib21.dll' was imported from a type library and cannot be re-exported to a type library. Make sure the type library from which the assembly was imported is registered.

C:\Windows\System32>

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Message 11 of 13

SanjoyNath
Advocate
Advocate

Dear @dbroad 

Dear Experts,

 

Now I Tried to use

 

C:\Program Files (x86)\Common Files\Autodesk Shared\Advance\AdvanceExportsCOM16.exe

(vlax-import-type-library :tlb-filename "C:\\Program Files (x86)\\Common Files\\Autodesk Shared\\Advance\\AdvanceExportsCOM16.exe" :methods-prefix "ASGTCm-" :properties-prefix "ASGTCp-" :constants-prefix "ASGTCc-")

 

SanjoyNath_1-1619132469870.png

 

 

As per your suggestion to call exe files referencing directly

I tried 

SanjoyNath_2-1619132580572.png

 

...............
LOG Apropos results
...............
ASGTCc-eConversionApp
ASGTCc-eConversionGTC
ASGTCm-ExportCIS2
ASGTCm-ExportIFC
ASGTCm-ExportPSS
ASGTCm-ExportSDNF
ASGTCm-GetAbortStatus
ASGTCm-HandleGTCSectionNotFound
ASGTCm-HandleImportFailed
ASGTCm-HandleMaterialNotFound
ASGTCm-HandleProfileNotFound
ASGTCm-ImportCIS2
ASGTCm-ImportIFC
ASGTCm-ImportPSS
ASGTCm-ImportSDNF
ASGTCm-SetApplication
ASGTCm-SetEventsHandler
ASGTCm-SetHostApplication
ASGTCp-get-Annotation
ASGTCp-get-AppIndex
ASGTCp-get-Application
ASGTCp-get-BeamOrientation
ASGTCp-get-BentBeamExportType
ASGTCp-get-Building
ASGTCp-get-CardinalPointAlwaysCenter
ASGTCp-get-Client
ASGTCp-get-CopeDrillDia
ASGTCp-get-CopeDrillType
ASGTCp-get-Drawer
ASGTCp-get-ExportCV2_0
ASGTCp-get-ExportHoles
ASGTCp-get-ExportSilentMode
ASGTCp-get-ExportType
ASGTCp-get-Features
ASGTCp-get-Lookup
ASGTCp-get-MajorVersion
ASGTCp-get-MinorVersion
ASGTCp-get-NotDefinedNumber
ASGTCp-get-OrderDate
ASGTCp-get-Precision
ASGTCp-get-ProfileDb
ASGTCp-get-Statics
ASGTCp-get-StrMajorVersion
ASGTCp-get-StrMinorVersion
ASGTCp-get-Version
ASGTCp-put-Annotation
ASGTCp-put-AppIndex
ASGTCp-put-Application
ASGTCp-put-BeamOrientation
ASGTCp-put-BentBeamExportType
ASGTCp-put-Building
ASGTCp-put-CardinalPointAlwaysCenter
ASGTCp-put-Client
ASGTCp-put-CopeDrillDia
ASGTCp-put-CopeDrillType
ASGTCp-put-Drawer
ASGTCp-put-ExportCV2_0
ASGTCp-put-ExportHoles
ASGTCp-put-ExportSilentMode
ASGTCp-put-ExportType
ASGTCp-put-Features
ASGTCp-put-Lookup
ASGTCp-put-MajorVersion
ASGTCp-put-MinorVersion
ASGTCp-put-NotDefinedNumber
ASGTCp-put-OrderDate
ASGTCp-put-Precision
ASGTCp-put-ProfileDb
ASGTCp-put-Statics
ASGTCp-put-StrMajorVersion
ASGTCp-put-StrMinorVersion
ASGTCp-put-Version
...............
72 symbols containing "asgtc"
...............

 

DID NOT WORK FOR AdvanceOdbcJetServer8x86.exe
(vlax-import-type-library :tlb-filename "C:\\Program Files (x86)\\Common Files\\Autodesk Shared\\Advance\\AdvanceOdbcJetServer8x86.exe" :methods-prefix "ASOm-" :properties-prefix "ASOp-" :constants-prefix "ASOc-")

 

SanjoyNath_3-1619132940979.png

 

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Message 12 of 13

SanjoyNath
Advocate
Advocate

Dear Experts,

 

 

 

Thanks God

This is Microsoft scripts control

 

the dll from the  C:\Windows\SysWOW64\scrrun.dll           dll file loading says true

Which means now we can handle file reads writing like vb6 styles through Autolisp

 

(vlax-import-type-library :tlb-filename "C:\\Windows\\SysWOW64\\scrrun.dll" :methods-prefix "MSCm-" :properties-prefix "MSCp-" :constants-prefix "MSCc-")

 

With Apropos window we have seen that the 128 Scripting(Microsofts dll ) functions are loaded 

 

SanjoyNath_0-1619135432387.png

 

 

 

...............
LOG Apropos results
...............
acDimScientific
acVpCustomScale
acZoomScaledAbsolute
acZoomScaledRelative
acZoomScaledRelativePSpace
MSCc-Alias
MSCc-Archive
MSCc-BinaryCompare
MSCc-CDRom
MSCc-Compressed
MSCc-DatabaseCompare
MSCc-Directory
MSCc-Fixed
MSCc-ForAppending
MSCc-ForReading
MSCc-ForWriting
MSCc-Hidden
MSCc-Normal
MSCc-RamDisk
MSCc-ReadOnly
MSCc-Remote
MSCc-Removable
MSCc-StdErr
MSCc-StdIn
MSCc-StdOut
MSCc-System
MSCc-SystemFolder
MSCc-TemporaryFolder
MSCc-TextCompare
MSCc-TristateFalse
MSCc-TristateMixed
MSCc-TristateTrue
MSCc-TristateUseDefault
MSCc-UnknownType
MSCc-Volume
MSCc-WindowsFolder
MSCm-Add
MSCm-BuildPath
MSCm-Close
MSCm-Copy
MSCm-CopyFile
MSCm-CopyFolder
MSCm-CreateFolder
MSCm-CreateTextFile
MSCm-Delete
MSCm-DeleteFile
MSCm-DeleteFolder
MSCm-DriveExists
MSCm-EncodeScriptFile
MSCm-Exists
MSCm-FileExists
MSCm-FolderExists
MSCm-GetAbsolutePathName
MSCm-GetBaseName
MSCm-GetDrive
MSCm-GetDriveName
MSCm-GetExtensionName
MSCm-GetFile
MSCm-GetFileName
MSCm-GetFileVersion
MSCm-GetFolder
MSCm-GetParentFolderName
MSCm-GetSpecialFolder
MSCm-GetStandardStream
MSCm-GetTempName
MSCm-Items
MSCm-Keys
MSCm-Move
MSCm-MoveFile
MSCm-MoveFolder
MSCm-OpenAsTextStream
MSCm-OpenTextFile
MSCm-Read
MSCm-ReadAll
MSCm-ReadLine
MSCm-Remove
MSCm-RemoveAll
MSCm-Skip
MSCm-SkipLine
MSCm-Write
MSCm-WriteBlankLines
MSCm-WriteLine
MSCp-get-AtEndOfLine
MSCp-get-AtEndOfStream
MSCp-get-Attributes
MSCp-get-AvailableSpace
MSCp-get-Column
MSCp-get-CompareMode
MSCp-get-Count
MSCp-get-DateCreated
MSCp-get-DateLastAccessed
MSCp-get-DateLastModified
MSCp-get-Drive
MSCp-get-DriveLetter
MSCp-get-Drives
MSCp-get-DriveType
MSCp-get-Files
MSCp-get-FileSystem
MSCp-get-FreeSpace
MSCp-get-IsReady
MSCp-get-IsRootFolder
MSCp-get-Item
MSCp-get-Line
MSCp-get-Name
MSCp-get-ParentFolder
MSCp-get-Path
MSCp-get-RootFolder
MSCp-get-SerialNumber
MSCp-get-ShareName
MSCp-get-ShortName
MSCp-get-ShortPath
MSCp-get-Size
MSCp-get-SubFolders
MSCp-get-TotalSize
MSCp-get-Type
MSCp-get-VolumeName
MSCp-put-Attributes
MSCp-put-CompareMode
MSCp-put-Item
MSCp-put-Key
MSCp-put-Name
MSCp-put-VolumeName
vla-get-CustomScale
vla-GetCustomScale
vla-put-CustomScale
vla-SetCustomScale
vla-ZoomScaled
...............
127 symbols containing "MSC"
...............

 

 

SanjoyNath_1-1619135678727.png

 

Sanjoy Nath
BIM Manager And Digital Lead (Structures Online)
BOOST, AR , VR ,EPM,IFC API,PDF API , CAD API ,Revit API , Advance Steel API
Founder of Geometrifying Trigonometry(C)
0 Likes
Message 13 of 13

jorgematheus_2011
Participant
Participant

Hi all

 

I'm trying 

(vlax-import-type-library :tlb-filename "C:\\Windows\\SysWOW64\\ntddll.dll" :methods-prefix "MSCm-" :properties-prefix "MSCp-" :constants-prefix "MSCc-")

 

But it doesn't work. Also i tryed

 

(vlax-import-type-library :tlb-filename "C:\\Windows\\SysWOW64\\Kernel32.dll" :methods-prefix "MSCm-" :properties-prefix "MSCp-" :constants-prefix "MSCc-")

 

Why scrrun.dll work and others don't ?

Regards

 

0 Likes