What's new

Implement Software into Alibre

ruesve

Member
Hello everybody,

I'm about to implement a software into alibre that i have a button in the ribbon-bar.

I looked at the addon's folder, and checked another addon wich was already installed.

I created the shortcut to the software, the ADC-File, the ICO-File and a dll. but i don't know what have to be in the dll to run a external software like for an example Google Chrome or any other exe.

How does the DLL to look like?

I tried to look at other compiled dll's in the addons folder but they are all not

Greetings,
Sven
 

simonb65

Alibre Super User
You need to make these examples 64Bit, so add a x64 build config, remove the WIN32 definition and add a WIN64 definition and modify the stdafx.h file to ...

Code:
// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//

#if !defined(AFX_STDAFX_H__AC28B15C_A45C_41A5_AD1B_48306C64D8DB__INCLUDED_)
#define AFX_STDAFX_H__AC28B15C_A45C_41A5_AD1B_48306C64D8DB__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define _WIN32_WINNT        0x0601    // Minimum = Windows 7 (see https://msdn.microsoft.com/en-us/library/aa383745(VS.85).aspx)

#define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers

#define _CRT_SECURE_NO_WARNINGS

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions

#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h>         // MFC OLE classes
#include <afxodlgs.h>       // MFC OLE dialog classes
#include <afxdisp.h>        // MFC Automation classes
#endif // _AFX_NO_OLE_SUPPORT


#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h>            // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT

#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h>            // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT

#include <afxdtctl.h>        // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>            // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT


#pragma warning( disable : 4786 )
#pragma warning( disable : 4192 )    // suppress IStream import duplicate warning

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

// Update to give correct/complete path of AlibreX.tlb
#ifdef WIN32
#import "C:\Program Files\Alibre Design\Program\AlibreX.tlb"
#endif
#ifdef WIN64
#import "C:\Program Files\Alibre Design\Program\AlibreX_64.tlb"
#endif
using namespace AlibreX;

// Update to give correct/complete path of AlibreAddOn.tlb
#ifdef WIN32
#import "C:\Program Files\Alibre Design\Program\AlibreAddOn.tlb" raw_interfaces_only
#endif
#ifdef WIN64
#import "C:\Program Files\Alibre Design\Program\AlibreAddOn_64.tlb" raw_interfaces_only
#endif
using namespace AlibreAddOn;

#pragma warning( default : 4192 )

#include "objidl.h"
#include <math.h>
#include <afxtempl.h>
#include <afxcoll.h>

#endif // !defined(AFX_STDAFX_H__AC28B15C_A45C_41A5_AD1B_48306C64D8DB__INCLUDED_)

That should get to started !
 
Last edited:

albie0803

Alibre Super User
I am also about to offer a thread file editor with addon button and have had some help creating the following.

If all you want to do is launch an external program and nothing else here are 2 dlls that will do the job.

ExternalAddOn.dll will launch a program. It looks for External.lnk so just name your shortcut "External"

ExternalUrlAddOn.dll will launch a webpage. It looks for External.url so just name your internet shortcut "External"

As soon as I find a bit of time I am going to write a "step by step" create-your-own addon button tutorial using these 2 files so you can have your favourite programs and websites in easy access.

There is no integration or information swapping, just "start it up"
 

Attachments

  • ExternalAddOn.zip
    17.6 KB · Views: 19

albie0803

Alibre Super User
Here is a ready made one for MoI 3.0 and one for the SKF cad webpage

Unpack the zips to "C:\Program Files\Alibre Design\Program\Addons"

The one for MoI assumes it is installed in the default location. If it is not you will need to edit the "External" shortcut and change its location.
The webpage one just calls the url so your default browser should be used.
 

Attachments

  • Moi3.zip
    96 KB · Views: 14
  • SKFModels.zip
    11.5 KB · Views: 12

ruesve

Member
@albie0803 I just saw your thread about running external software with buttons or to add buttons to alibre design.
This was just something what i was trying about, but at the moment i have no idea to code the dll or what does it have to contain,so it would be nice if i can use yours instead than writing my own.
 

albie0803

Alibre Super User
Sure you can, its why I posted it for people to use. Don't ask me though for any other sort of implementation, I can't help. I can code a bit of VB and will post my own Thread File Editor soon but that's it. I was lucky to be given source code for the dll and have a friend who is a programmer who was able to tweak it for me to get the 2 dll's.

From your original post it seems that you have everything else so just grab the ExternalAddon zip file above, drop the ExternalAddon.dll into your Add-On folder and follow my instructions in the other thread.https://www.alibreforum.com/forum/index.php?attachments/externaladdon-zip.24767/
 

DavidJ

Administrator
Staff member
I am also about to offer a thread file editor with addon button

That sounds great !! manually editing the custom thread file is no joke, even when you do know what you are doing.... I'm looking forward to your thread file editor becoming available.
 
Top