CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedScript writing advice needed

 Post Reply Post Reply Page  123>
Author
tieniemaree View Drop Down
Newbie
Newbie


Joined: 22.Sep.2015
Location: South Africa
Using: AutoCAD Lt 2016
Status: Offline
Points: 15
Direct Link To This Post Topic: Script writing advice needed
    Posted: 22.Sep.2015 at 17:23
Hi all,

As our company is moving over from CADDIE to AUTOCAD LT 2016, I would like to write a script that will reload the linetype file I have created in order for the plotted drawings to still appear the same, whether these existing drawings are plotted using CADDIE or AUTOCAD LT.

The second part or script should then select all linetypes PDASH2SPACE and set it to a new custom linetype I have created.

Lastly, a script to set all the linetype scales to 1.

If ALL of the above can be done in 1 script so much the better.
[I understand a Macro would have worked so much better but unfortunately AUTOCAD LT won't run Macro's, only scripts]

I have tried to write a textbook/manual for our users to guide them through this process step by step, but it is an arduous exercise that many find above their level of ability. Hence, writing a script will do these steps for them, or at least that is what I am hoping.

CAN ANYONE PLEASE ASSIST???
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 22.Sep.2015 at 18:46
AutoCAD LT does indeed utilize macros.  Anyone who tells you otherwise probably doesn't use the program to begin with or is an idiot.


Edited by John Connor - 22.Sep.2015 at 18:49
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 22.Sep.2015 at 18:49
An example taken directly from the AutoDesk Knowledge Base.

To load a specific linetype without using a dialog box, use the following syntax in your macro:

^C^C_filedia;0;_-linetype;L;<linetype name>;"<path>/<lin file>";;filedia;1;

For example:

^C^C_filedia;0;_-linetype;L;ACAD_ISO02W100;"C:/Documents and Settings/<user name>/Application Data/Autodesk/AutoCAD 2009/R17.2/enu/Support/acadiso.lin";;filedia;1;

Note: You should use forward slashes in the path.

"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 22.Sep.2015 at 18:54
A simple linetype scale macro might be ^C^CPLTSCALE;

"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
tieniemaree View Drop Down
Newbie
Newbie


Joined: 22.Sep.2015
Location: South Africa
Using: AutoCAD Lt 2016
Status: Offline
Points: 15
Direct Link To This Post Posted: 23.Sep.2015 at 13:06
Originally posted by John Connor John Connor wrote:

AutoCAD LT does indeed utilize macros.  Anyone who tells you otherwise probably doesn't use the program to begin with or is an idiot.


HAHA,
that was the answer I got from the local CAD training centre in Cape Town! haha... however, they have since replied to my email and said they are investigating as there appears to be a couple of options.
Back to Top
tieniemaree View Drop Down
Newbie
Newbie


Joined: 22.Sep.2015
Location: South Africa
Using: AutoCAD Lt 2016
Status: Offline
Points: 15
Direct Link To This Post Posted: 23.Sep.2015 at 13:09
@John

thanks for your input. I am trying to teach myself about scripting and macros so progress is slow, however your input is much appreciated!

stupid question: if I wrote a macro, can other users on their pc's also run it? can i send them the file and just instruct them to run the script? [i know it's probably is stupid question, like i said, im a novice at this stage...]
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 23.Sep.2015 at 16:22
Macros and scripts are not the same thing and you should not be mixing the terminology.

Yes, your macro or script should run.  There will always be that one "gotcha" exception though and since it is random you can't plan for it.
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
tieniemaree View Drop Down
Newbie
Newbie


Joined: 22.Sep.2015
Location: South Africa
Using: AutoCAD Lt 2016
Status: Offline
Points: 15
Direct Link To This Post Posted: 23.Sep.2015 at 16:26
Originally posted by John Connor John Connor wrote:

Macros and scripts are not the same thing and you should not be mixing the terminology.

Yes, your macro or script should run.  There will always be that one "gotcha" exception though and since it is random you can't plan for it.


ok thanks, and sorry for mixing the terminology!

i am making relatively good progress. this morning I was useless, I have since written a script to thaw, switch on, unlock all layers and to load the selected linetypes.

now I need to set all the entities to linescale 1 (those that arent) and the only way seems to be by means of using the Quickselect function, which means a script cannot be written for it as its a dialogue box - am i correct in saying this? now what???
Back to Top
John Connor View Drop Down
Senior Member
Senior Member


Joined: 01.Feb.2011
Location: United States
Using: AutoCAD 2018
Status: Offline
Points: 7175
Direct Link To This Post Posted: 23.Sep.2015 at 16:38
You must be aware that there are command line versions of commands that open some dialog windows aren't you?

For example: LAYER will bring up the Layer Properties Manager while -LAYER will show the options on the command line.
"Humans have a strength that cannot be measured. This is John Connor. If you are reading this, you are the resistance."

<<AutoCAD 2015>>

Back to Top
tieniemaree View Drop Down
Newbie
Newbie


Joined: 22.Sep.2015
Location: South Africa
Using: AutoCAD Lt 2016
Status: Offline
Points: 15
Direct Link To This Post Posted: 23.Sep.2015 at 16:39
Originally posted by John Connor John Connor wrote:

You must be aware that there are command line versions of commands that open some dialog windows aren't you?

For example: LAYER will bring up the Layer Properties Manager while -LAYER will show the options on the command line.


yes I am aware of that
Back to Top

Related CAD tips:


 Post Reply Post Reply Page  123>
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,109 seconds.