• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

upload a file lisp only on selected designs

  • Thread starter Thread starter Pino89
  • Start date Start date

Pino89

Guest
hi to everyone, I just started studying the lisp language and I can't find it so difficult.
But I wondered if there was a way to upload files only on certain designs, based on a characteristic of the design.
For example, in my case, I have two views called "field 2" and "field 4" and I would need autocad to automatically load the file lisp "view.lsp" (in which there are the quick controls for the views) only if in the design there is a view with the name "camp 2" or "field 4" (not by force both).
I had thought about the "cond", but I don't know how to get him looking for the specified view.
I hope you understood and thank you in advance for the help :smile: :wink:
 
Sorry, but at work I didn't have much time for presentations.
the utility lies in the fact that being very lazy, I use the same three keyboard commands for three different preset views in each design, but I would like to leave that command free for the other drawings
 
this procedure should work:

supposing that view.lsp is present in a folder of the autocad path and that the command to launch the lisp is commands_rapid, open the acadxxxxdoc.lsp file (xxxx = autocad version) and enter before ;; silent load. these lines of code
Code:
[color=RED]([/color][color=BLUE]sec[/color] v1 [color=RED]([/color][color=BLUE]cdr[/color] [color=RED]([/color][color=BLUE]Ascension[/color] [color=#009900]2[/color] [color=RED]([/color][color=BLUE]tblnext[/color] [color=#a52a2a]"view"[/color] [color=BLUE]t[/color][color=RED]))))[/color][color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]elenco_v[/color] [color=RED]([/color][color=BLUE]list[/color] v1[color=RED]))[/color] [color=RED]([/color][color=BLUE]while[/color] [color=RED]([/color][color=BLUE]/=[/color] v1 [color=BLUE]nil[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]sec[/color] v1 [color=RED]([/color][color=BLUE]cdr[/color] [color=RED]([/color][color=BLUE]Ascension[/color] [color=#009900]2[/color] [color=RED]([/color][color=BLUE]tblnext[/color] [color=#a52a2a]"view"[/color][color=RED]))))[/color]
[color=RED]([/color][color=BLUE]if[/color] [color=RED]([/color][color=BLUE]/=[/color] v1 [color=BLUE]nil[/color][color=RED])[/color] [color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]elenco_v[/color] [color=RED]([/color][color=BLUE]append[/color] [color=BLUE]elenco_v[/color] [color=RED]([/color][color=BLUE]list[/color] v1[color=RED]))))[/color][color=RED])[/color][color=RED]([/color][color=BLUE]if[/color] [color=RED]([/color][color=BLUE]or[/color]
[color=RED]([/color][color=BLUE]member[/color] [color=#a52a2a]Camp 2[/color] [color=BLUE]elenco_v[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]member[/color] [color=#a52a2a]"field 4"[/color] [color=BLUE]elenco_v[/color][color=RED])[/color]
[color=RED])[/color]
[color=RED]([/color][color=BLUE]progn[/color]
[color=RED]([/color][color=BLUE]load[/color] [color=#a52a2a]"view"[/color][color=RED])[/color]
[color=RED]([/color]c:comandi_rapidi[color=RED])[/color]
[color=RED])[/color][color=RED])[/color]
:smile::smile::smile:
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top