Using Scripts instead of LISP

Using Scripts instead of LISP

Anonymous
Not applicable
6,077 Views
18 Replies
Message 1 of 19

Using Scripts instead of LISP

Anonymous
Not applicable

Hi everyone!

 

I recently bought the Autocad LT 2018 and I saw that LT doesn't support LISP command. I search altenative methods to execute this type of commands and I came across with SCRIPTS and MACROS. I don't understand anything related that kind of extensions files or programming...

 

Can you help me?

 

(see attachment) In short, I would like to use the same file but with an extension (SCR or MACRO) to run properly on Autocad LT.

 

Thanks in advance!

 

AP

 

 

0 Likes
Accepted solutions (1)
6,078 Views
18 Replies
Replies (18)
Message 2 of 19

h_s_walker
Mentor
Mentor

Welcome to the Forums


What does the lisp do? I just tried opening it in Notepad and it's a protected lisp file.

Howard Walker
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.

EESignature


Left Handed and Proud

0 Likes
Message 3 of 19

rkmcswain
Mentor
Mentor
You can't just rename a .LSP file to .SCR.

AutoCAD LT is much less expensive to rent than AutoCAD, and the lack of ability to run lisp code is part of that reason.

As @h_s_walker says, the lisp file you posted is encrypted. Are you the author of this? If so, post the source code. If not, then the author probably does not want his/her code to be copied.

Maybe you could explain to us what this lisp file accomplishes, and someone could possibly tell you how to do the same thing in AutoCAD LT.



R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 4 of 19

pendean
Community Legend
Community Legend
"scripts" and "macros" simply repeat what you can do at the commandline with stock commands with no pop-ups. LISP is so much more than that.

So no, about 85% of LISP tools cannot be converted to scripts or macros. And just changing the extension doesn't fool a program at all.
Message 5 of 19

Anonymous
Not applicable

Hello everyone! Thanks for your fast answer.

 

The LSP author is unknown, because I had this file from a friend, which is not the original author and yes, the file is encrypted... I just saw it now...

 

Note: I know I can't rename the extension .LSP to .SCR (I explained it in a wrong way). What I wanted to know was if I could use this LSP command, with the same philosophy but build it in SCR or MACRO format, which I am not able to do so. 

 

In attachment, there is a test DWG that I created to clarify you all what is this LSP specifically. This LSP creates "slopes" symbology (in my case, I use it in Archaeology drawings).

 

The LSP command is the following (this LSP is in Portuguese, so the bellow explanation is translated):

 

Select File: Taludes.lsp (slope)

Select Polyline (in red)

Select Long Line Size (in green): 0.05

Select Short Line Size (in yellow): 0.025

Select Distance Between Lines: 0.025

Number of Short Lines: 2

 

Basically, this creates the slope symbology along the polyline. I don´t know if this can be helpful but I did my best Smiley Wink

 

Thank y'all!

 

AP

0 Likes
Message 6 of 19

pendean
Community Legend
Community Legend
What does the final result look like? Your lisp doesn't work as you've describe.
0 Likes
Message 7 of 19

Anonymous
Not applicable

The final result is in the DWG file that I attached before! The colours were only for the explanation.

 

Maybe I lost something in the translation, because the LSP file author was Portuguese and the commands are also in Portuguese...

0 Likes
Message 8 of 19

pendean
Community Legend
Community Legend

OK, so you just want to draw a bunch of lines in a pattern like this, but you want to control the height of yellows/greens and the spacing

 

Capture.PNG

 

 

Correct?

 

 

0 Likes
Message 9 of 19

Anonymous
Not applicable

That's correct!

0 Likes
Message 10 of 19

Anonymous
Not applicable

@pendean wrote:

OK, so you just want to draw a bunch of lines in a pattern like this, but you want to control the height of yellows/greens and the spacing

 

Capture.PNG

 

 

Correct?

 

 


That's correct pendean

0 Likes
Message 11 of 19

JPomeroy
Advocate
Advocate

Are the lengths and separations of the lines variable?  I don't think a script will work for something that has variables.

 

The only things I use scripts for is stuff that is always the same (setting up layers, etc.) so this may be beyond my amateurish script-writing abilities.

0 Likes
Message 12 of 19

pendean
Community Legend
Community Legend

Is this below the intent of the final result? How you would use it in context in your files?

 

Capture.PNG

 

 

0 Likes
Message 13 of 19

Anonymous
Not applicable

What happend to all of the latest posts? 

0 Likes
Message 14 of 19

JPomeroy
Advocate
Advocate

That's really strange- looks like we lost a bunch of posts.  Don't know what happened there.

0 Likes
Message 15 of 19

Discussion_Admin
Alumni
Alumni

Accidental removal with some duplicate posts they have been returned

 

sorry for the inconvenience
Discussion_Admin

 

 

Message 16 of 19

Anonymous
Not applicable

@pendean wrote:

Is this below the intent of the final result? How you would use it in context in your files?

 

Capture.PNG

 

 


Thanks again for your patience pendean.

 

This procedure always uses the same values. The Long Line always have 0.05m, the 2 Short Lines always have 0.025m and the spacing between the lines is 0.025m. I use this operation along a Polyline. I've already tried with Measure along a Path (by block) and Array along a path but it's not the best way, visually speaking...

0 Likes
Message 17 of 19

h_s_walker
Mentor
Mentor

Sounds like you need a dynamic block.

 

Dynamic Block Forums

Howard Walker
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.

EESignature


Left Handed and Proud

Message 18 of 19

pendean
Community Legend
Community Legend
Accepted solution
>>>...This procedure always uses the same values....<<<
If it is always the same exact values, why aren't you using a block (or blocks, or a single dynamic block) instead of a lisp routine that draws a bunch of unconnected lines?
For a quick block solution, open an existing file with this in it, select all the objects, start BLOCK command, give it a name, and there you go. Done.
Message 19 of 19

Anonymous
Not applicable

@pendean wrote:
>>>...This procedure always uses the same values....<<<
If it is always the same exact values, why aren't you using a block (or blocks, or a single dynamic block) instead of a lisp routine that draws a bunch of unconnected lines?
For a quick block solution, open an existing file with this in it, select all the objects, start BLOCK command, give it a name, and there you go. Done.

Hi pendean!

 

Thanks for your advice. I've tried Dynamic Blocks and I almost solve the problem. Whoever, the "problem" is with the shape, because in a irregular Polyline and "my block" is like an orthogonal shape. Nonetheless, I accept your solution and I'll try to tune this in the future. Thanks for your time!

 

AP