Skip to main content
1-Visitor
September 29, 2016
Solved

How could I make macros and compile? I use creo elements/Direct 18.1

  • September 29, 2016
  • 3 replies
  • 5380 views

Hello Community,

 

I have a problem, I don´t know how can I make and compile macros with Creo elements/Direct 18.1. If someone have manuals or could tell me how make it I would be very gratefull

 

Thank you


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
Best answer by wvangeem

Hi Ruben,

Let's say you have some macro's in a file "C:\temp\mymacros.m" and you want to store/compile/secure them into a binary, not-readable file, you can do the following:

Warning: after these actions you will need to restart your Drafting session.

DELETE_MACRO ALL {Remove all macro's from your memory in your Drafting session}

INPUT "C:\temp\mymacros.m" {Load your macro's into memory}

SECURE_MACRO ALL {Secure your macros from reading}

STORE_MACRO ALL "C:\temp\mymacros.bin"

Now you can load your stored macros with LOAD_MACRO "C:\temp\mymacros.bin"

If you omit the SECURE_MACRO ALL, the macro will be compiled, but when loaded into your Drafting session, you will still be able to do an EDIT_MACRO and see the contents of a macro.

Best regards,

Wim

3 replies

4-Participant
September 30, 2016

Please see the following link for more information on compiling

CoCreate Modeling FAQ: Lisp compiler

Although this web page is not updated for some time, it includes some basic and important information

1-Visitor
September 30, 2016

Hello,

If it is for Drafting, writing macro is very simple: see in C:\Program Files\PTC\Creo Elements\Direct Drafting 19.0\Help\project\WEB-INF\volume, unzip DirectDrafting_xx,

and look at DirectDrafting_PDF\writemac.pdf.

It is not necessary to compile macros as nowadays, the pc are fast. More, compiled macros may not be compatible with next versions of Drafting.

See some examples on my blog Gerard's Blogue

rangulo1-VisitorAuthor
1-Visitor
October 4, 2016

Thank you, I didn´t know nothing about that manual. I can make macros now. Thank you again

wvangeem12-AmethystAnswer
12-Amethyst
October 4, 2016

Hi Ruben,

Let's say you have some macro's in a file "C:\temp\mymacros.m" and you want to store/compile/secure them into a binary, not-readable file, you can do the following:

Warning: after these actions you will need to restart your Drafting session.

DELETE_MACRO ALL {Remove all macro's from your memory in your Drafting session}

INPUT "C:\temp\mymacros.m" {Load your macro's into memory}

SECURE_MACRO ALL {Secure your macros from reading}

STORE_MACRO ALL "C:\temp\mymacros.bin"

Now you can load your stored macros with LOAD_MACRO "C:\temp\mymacros.bin"

If you omit the SECURE_MACRO ALL, the macro will be compiled, but when loaded into your Drafting session, you will still be able to do an EDIT_MACRO and see the contents of a macro.

Best regards,

Wim

rangulo1-VisitorAuthor
1-Visitor
October 4, 2016

Thank you so much. I´ve got it.

13-Aquamarine
October 31, 2016

Don't forget to keep the "unsecured Macros" (=your source code) in a safe location.

There is no (official) way to revert unsecured macros back to readable source code.

Concerning "compatibility":

A secured Macro is not more or less compatible than the unsecured source code.

If a new version of CAD (Drafting, Annotation) introduces a change that impacts your Macro,

you have to change/adopt it (regardless if unsecured or secured).

Hope this helps.

Regards,

      Max