how to install dll class library and modify civil 3d menus?

how to install dll class library and modify civil 3d menus?

wang890
Collaborator Collaborator
1,264 Views
5 Replies
Message 1 of 6

how to install dll class library and modify civil 3d menus?

wang890
Collaborator
Collaborator
say i programmed 1 or more dll files which each can contain 1 or more command which pop up a form once use netload into civil 3d. how do i create a installation packate which i can burn on to a disk and distribute to other people which once installed, then if the guy start civil 3d then he sees the new custom menu and may new tool bars with icons. so do i have to create a cui file first, but how to make civil 3d know to load the new cui file and the dll files. some dude posted something on some discussion group showing people how to install dll onto a machine. but that's just for 1 machine. i know how to create deployments in .net. but for example look at rdv system, autoturn. how does those people make installation package and stick inside civil 3d? i know it can be done. nothing can't be programmed programmatically. but i need to know how. anybody willing to share some knowledge? i have been nice and a keener on answering many people's questions.

thank you

Bob
HMM
Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19
1,265 Views
5 Replies
Replies (5)
Message 2 of 6

Civil3DReminders_com
Mentor
Mentor
Check out the Download from the Aug 17, 2007 class on AutoCAD: Creating an Installer
http://www.adskconsulting.com/adn/cs/api_course_sched.php
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
0 Likes
Message 3 of 6

Anonymous
Not applicable
Hi Bob,

"Inno Setup" is the obvious solution for creating an installation
program for software distribution. It's free, easy to use and more
powerful than you'll ever need.

Although there are more elegant solutions for telling AutoCAD to load
your menus available with C++, here is one which works using lisp:

Copy LoadMyMenu.lsp to the AutoCAD\Support\temp folder with Inno Setup.
This is the program which does the work of loading the menu (and or
other program parts) Note that it gets deleted after its first run

From Inno Setup (with its Code functionality in Pascal script) append
to the Acad.LSP file code to find the LoadMyMenu.lsp, load it if found
and then delete it with code like:


(vl-load-com)

(setq sProgramPath (vl-registry-read
"HKEY_LOCAL_MACHINE\\Software\\Autodesk\\AutoCAD\\R17.2\\ACAD-7000:409"
"Location"))

(setq sAcadLisp2 (strcat sProgramPath "\\Support\\Temp\\LoadMyMenu.lsp"))

(if (findFile sAcadLisp2) (progn (load sAcadLisp2) (vl-file-delete
sAcadLisp2)))



The LoadMyMenu.lsp contains code like:


(defun HowMany ( / i z)
(setq i 1)
(setq z (menucmd (strcat "P" (itoa i) ".1=?")))
(while (= z (menucmd (strcat "P" (itoa i) ".1=?")))
(setq i (+ i 1))

) ; end while
(setq i (- i 2))
) ; End Defun HowMany


(defun MyLandMenu ( / x y sMyProgramPath vEcho)
(setq vEcho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(setq sMyProgramPath (vl-registry-read
"HKEY_LOCAL_MACHINE\\Software\\CADApps\\MyProgram" "InstallPath"))
(if (not (= sMyProgramPath ""))
(progn
(if (Menugroup "MyMenuGroup") (command "menuunload" "MyMenuGroup"))
(command "menuload" (strcat sMyProgramPath
"\\MyProgram\\Programs\\MyMenu.cui"))

(setq x (+ (HowMany) 1))

(setq y (strcat "p" (itoa x) "=+MyMenuGroup.Pop1"))
(menucmd y)
(setq x (+ x 1))

(setq y (strcat "p" (itoa x) "=+MyMenuGroup.Pop2"))
(menucmd y)
(setq x (+ x 1))

(setq y (strcat "p" (itoa x) "=+MyMenuGroup.Pop3"))
(menucmd y)

) ; End progn
(Alert "My Program Installation path not found in Windows Registry.
\nMy Program program menus will not be loaded and the
program will not run.
\nThe menu file 'MyMenu.cui' can't be found in the
'...\\MyProgram\\Programs' directory
\n\nIf needed please contact our support.
'[email protected]'

")
) ; End if

(setvar "CMDECHO" vEcho)
(princ)
) ; End Function

(MyLandMenu)



The LoadMyMenu.lsp code can be improved on with further understanding of
lisp and CUI programming, but I never bothered.

If you don't have any Pop menus for your program, then you can omit the
code associated with them.

Regards


Laurie Comerford


wang890 wrote:
> say i programmed 1 or more dll files which each can contain 1 or more
> command which pop up a form once use netload into civil 3d. how do i
> create a installation packate which i can burn on to a disk and
> distribute to other people which once installed, then if the guy start
> civil 3d then he sees the new custom menu and may new tool bars with
> icons. so do i have to create a cui file first, but how to make civil 3d
> know to load the new cui file and the dll files. some dude posted
> something on some discussion group showing people how to install dll
> onto a machine. but that's just for 1 machine. i know how to create
> deployments in .net. but for example look at rdv system, autoturn. how
> does those people make installation package and stick inside civil 3d? i
> know it can be done. nothing can't be programmed programmatically. but i
> need to know how. anybody willing to share some knowledge? i have been
> nice and a keener on answering many people's questions. thank you Bob HMM
0 Likes
Message 4 of 6

wang890
Collaborator
Collaborator
thanks, Laurie, but can you edit your post so it is rich text, which the code looks better. anyways that seems complicated. so the Inno Setup is better than the one microsoft made in their IDE?
Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19
0 Likes
Message 5 of 6

Anonymous
Not applicable

Hi Bob,

 

The code appears quite well formatted in Outlook
Express and Thunderbird - subject to the issues of word wrap which always
occurs.

 

As to whether Inno Setup is better than MS
products, how can I offer my opinion without ever having used the MS
processes.

 

When I first started creating Install
programs I started with Install Shield.  After 4 hours or so of
reading about it and experimenting I still hadn't successfully created a "Hello
World" Install.

 

I then tried Wise and was able to get a "Hello
World" Install working after about 2 hours.

 

I then moved to Inno Setup and had a fully working
program install in about 10 minutes.  I've spent many hours since then
adding sophistication to installs, but have only run into one item which you
have to work around in circles to achieve with it - reading the MAC address of
the computer.  Eventually this was resolved by running lmhostid.exe and
piping it's output to a file which I read with Inno Setup.  This is
probably only necessary if you are using FlexLM as your licencing system and if
you are then you will have lmhostid.exe available

 

 

Regards

 

 

Laurie Comerford

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
thanks,
Laurie, but can you edit your post so it is rich text, which the code looks
better. anyways that seems complicated. so the Inno Setup is better than the
one microsoft made in their IDE?
0 Likes
Message 6 of 6

Anonymous
Not applicable

Hi,

 

Sorry i didnt get you both. Please can you explain a little bit detailly, how to install DLL files on other machines using C3D 2011 and what does inno setup do exactly, does it open the solution on VB.net or opens DLL file and prepare a setup for it. Also how can i setup the DLL file on one machine

 

Thanks,

 

Tamer

0 Likes