Macros not working from lt 2011 to lt 2017

Macros not working from lt 2011 to lt 2017

Anonymous
Not applicable
1,808 Views
8 Replies
Message 1 of 9

Macros not working from lt 2011 to lt 2017

Anonymous
Not applicable

Hey guys,

 

I've spent quite a bit of time creating some company macros to make our users life easier and faster. I am using an enterprise cuix to distribute it through our offices.

 

What I have found though is the macros will work in Autocad lt 2011 and up until you get to lt 2017 when they don't work. I'm not sure why they don't work. There is nothing very fancy in the script. 

 

Here is an example:

^C^C-layer;s;"MS Blocks";
^C^Cinsert;"Fixtures Block.dwg";0,0;1


;^C^Cscale;l;;0,0;0.75;
^C^Cexplode;l;

;
^C^Cinsert;"Dynamic LED Strip Ceiling 25.dwg";-5,-7685;;;;;
^C^Cinsert;"Dynamic LED Strip Floor 25.dwg";-5,-8060;;;;;
^C^Cinsert;"Dynamic LED Strip Type 2 Ceiling 25.dwg";-5,-8435;;;;;
^C^Cinsert;"Dynamic LED Strip Type 2 Floor 25.dwg";-5,-8810;;;;;^C^Cinsert;"TFB Centre Line Text 25 Ceiling Dynamic.dwg";-5,-9308;;;;

^C^Cinsert;"Centre Line Text 25 Floor Dynamic.dwg";-5,-9807;;;

;^C^C-dimstyle;r;"TFB MS 3mm at 1 to 25"

;
^C^C-style;"TFB MS 3mm at 1 to 25"

;^C^Czoom;e
^C^C-layer;s;"TFB MS Xref";;

 

Any suggestions?


Cheers

0 Likes
Accepted solutions (1)
1,809 Views
8 Replies
Replies (8)
Message 2 of 9

pendean
Community Legend
Community Legend
Looks like a script file content, not individual macros. Which is it? Is one of the lines specifically ffailing>

Explain "they don't work" please?

For example, your LAYER macros, they way they are written, assume the layer already exists in the file. Do they? A better method is to use the MAKE suboption in LAYER command for example.

and if you start using annotative text and dimstyles you can drop many of your forced scales "1 to 25" and the like too.
0 Likes
Message 3 of 9

Emmsleys
Alumni
Alumni

Hi @Anonymous and welcome to the AutoCAD LT forums. 

 

I believe this post would be best suited for our Customization board, I'll go ahead and move it over there. 



Sarah Emmsley
Technical Support Specialist

0 Likes
Message 4 of 9

Anonymous
Not applicable

Hi Dean,

 

Thanks for your response.

 

I am not using scripts (we only have LT here). This code is all written in the macro section of each button in the cui.

 

Yes, the layers would already exist as each drawing created here starts with one of our templates. If I used make, and the layer exists, that would cause an issue right?

 

I couldn't get annotative text to work for us. It was causing issues with my dynamic blocks also so I decided to leave it.

 

So in lt 2011 the macro works perfectly. In 2013 and 2017 I get it trying to insert a fifth Dynamic LED block. If I take a ; away it works correctly although I want to be able to have the same command through the whole office so I can easily update each cuix using an enterprise cuix file.

0 Likes
Message 5 of 9

Ed__Jobe
Mentor
Mentor
Accepted solution

Just curious, can LT run the SCRIPT command?

 

As a new version comes out, they can change how an existing command operates. This can change the command line options. If there is a difference from version to version in the command line syntax of a particular command , then you won't be able to use the same cuix file for each installation. To troubleshoot where the issue is, test each line by pasting it to the command line. If you notice a problem, dig deeper and find out how the command has changed.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 6 of 9

Anonymous
Not applicable

Hi Ed.Jobe,

 

Thanks for responding. Sorry I didn't write back sooner.

 

I am investigating this now. I didn't realise it was possible to use the script command in LT. Can I ask why you think it will benefit? I don't know much about using script so am curious because I will learn if it will be better/easier.

 

You must be right and it is just a version problem. I will break down each line and get back to you soon.


Thanks!

0 Likes
Message 7 of 9

Ed__Jobe
Mentor
Mentor

I just thought it would be easier to troubleshoot a script. You don't have to modify the cui each time you want to make a change. You edit the script in Notepad and save then run the script.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 8 of 9

Anonymous
Not applicable

Hi again,

 

Thank you so much for your help.

 

I have successfully written a script and have it working. I am now tweaking it to work across the different versions because, as you say, it is a version thing.

 

But the solution you have provided has made it much easier to implement across the office.

 

Many thanks

Message 9 of 9

Anonymous
Not applicable

Also turns out that attdia was turned on, on one of the 2017 machines. When I tested today I freaked out but realised, so now it is fixed!

 

There actually isn't any issue running the script between versions. I have it all sorted now.