cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

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

rangulo
1-Visitor

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

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.
ACCEPTED SOLUTION

Accepted Solutions
wvangeem
12-Amethyst
(To:rangulo)

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

View solution in original post

6 REPLIES 6
ndodelova
4-Participant
(To:rangulo)

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

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

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

wvangeem
12-Amethyst
(To:rangulo)

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

Thank you so much. I´ve got it.

MaxR.Kublin
13-Aquamarine
(To:rangulo)

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

Announcements


Top Tags