Jump to content

Recommended Posts

Posted

Hi!

I have two routines:

;                            UPTRIM
;  ROTINA PARA TRAÇAR LINHA DE CORTE E EXECUTAR COMANDO TRIM
;    FEITA POR L.A.CAETANO
;___________________________________________________________________________

(defun c:Uptrim(/ LAYCOR pt1 pt2)
 
(setq LAYCOR (getvar "clayer")) ;Guarda o layer corrente.
 
(command "_.ortho" "_off") ;Desliga o modo ortho.

(setq pt1 (getpoint "\nPrimeiro ponto : ")) ;Início da linha de corte.

(setq pt2 (getpoint "\nSegundo ponto : ")) ;final da linha de corte.

(command "-layer" "S" "CONST" "") ;Torna o layer Const corrente.
 
(command "_line" pt1 pt2 "") ;Traça a linha de corte
 
(command "_TRIM" "@0,0" "" Pause"") ;Ativa o comando trim e seleciona a linha de corte.
 
(setvar "clayer" LAYCOR) ;Retorna ao layer original.
 
(command "_erase" "P" "") ;Apaga a linha de corte.

 (princ)
 )

 (princ)

 

 

;                            UPEXTEN
;  ROTINA PARA TRAÇAR LINHA DE CORTE E EXECUTAR COMANDO EXTEND
;    FEITA POR L.A.CAETANO
;___________________________________________________________________________

;***************************************************************************

(defun c:Upexten(/ LAYCOR pt1 pt2)
 
(setq LAYCOR (getvar "clayer")) ;Guarda o layer corrente.
 
(command "_.ortho" "_off") ;Desliga o modo ortho.

(setq pt1 (getpoint "\nPrimeiro ponto : ")) ;Início da linha de corte.
 
(setq pt2 (getpoint "\nSegundo ponto : ")) ;final da linha de corte.
 
(command "-layer" "S" "CONST" "") ;Torna o layer Const corrente.
 
(command "_line" pt1 pt2 "") ;Traça a linha de corte
 
(command "_EXTEND" "@0,0" "" Pause"") ;Ativa o comando Extend e seleciona a linha de corte.
 
(setvar "clayer" LAYCOR) ;Retorna ao layer original.
 
(command "_erase" "P" "")) ;Apaga a linha de corte.

 (princ)
 )

 (princ)

 

The first one, automaticaly loads with each drawing I open.

The second doesn't, I have to load it manualy.

I did the same procedures for both.

Without discussing the structure of the two, because they work normally after loaded, someone can tell me why this happens?

Posted (edited)

Hi Luancat,

 

 

could you please, explain to us what are 'the same procedures for both'...

 

The second routine, have an extra )) ;Apaga a linha de corte.

 

 

Henrique

Edited by hmsilva
typo
Posted

Hi guys!

I think it will answer both of You.

The same procedures means what Spaj told me to do. I,ve done everything stated in the link: Startup suite, Acaddoc, folders in the trust location...

My lisp, is in: Appdata/Roaming/Autodesk/AutoCad 2014........./Suport and there is a copy of all in the ApplicationsPlugins folder even the Acaddoc.lsp. I'll pass through it all again and see if I didin't miss something (I've done already but..knows...) I'll tell you after.

Thank you both.

Posted

The second routine, have an extra )) ;Apaga a linha de corte.

 

Hi Luancat,

did you read all my previous post?

The second code, have an extra right paren, you'll have to remove the red paren...

 

Henrique

Posted

Hi, again!

 

Its odd, after I've done a new acaddoc others programs doesn't load. Can you see if there is something wrong with that, please.

 

; ACAD.LSP
; ACAD.LSP Version 1.0 for Autocad 2012
;
;
(autoload "lica" '("lica"))
(autoload "lican" '("lican"))
(autoload "licang" '("licang"))
(autoload "lichor" '("lichor"))
(autoload "lichor2" '("lichor2"))
(autoload "lichor3" '("lichor3"))
(autoload "licofs" '("licofs"))
(autoload "licofs2" '("licofs2"))
(autoload "licofs3" '("licofs3"))
(autoload "licper" '("licper"))
(autoload "licper2" '("licper2"))
(autoload "licper3" '("licper3"))
(autoload "licver" '("licver"))
(autoload "licver2" '("licver2"))
(autoload "licver3" '("licver3"))
(autoload "R90" '("R90"))
(autoload "R91" '("R91"))
(autoload "Retrim" '("Retrim"))
(autoload "RETRIMex" '("Retrimex"))
(autoload "Uptrim" '("Uptrim"))
(autoload "MACROS")
(autoload "Upexten" '("Upexten"))
(autoload "PW" '("PW"))
(autoload "ZeraZ" '("zz")))
;;
;; silent load.

It is stored in the support folder.

"Obrigado"

Posted

Hi, hmsilva,

 

I've read and did it before my last reply.

 

thanks

Posted (edited)

If copy/paste at command line

(findfile "acaddoc.lsp")

the returned path is from your acaddoc.lsp file, or other?

 

 

EDIT:

Luancat, your file header says 'ACAD.LSP', but your file is 'acaddoc.lsp', correct?

 

AutoCAD will search for a file, at the 'Support Search Path' and current directory, and loads the first found file.

 

In my acaddoc.lsp, paths are hardcoded, to avoid AutoCAD load the first found file with the same name, please note, if the file extension is omitted, AutoCAD will load the first found file with the same name, and a .lsp, .fas or .vlx as extension...

e.g.

(autoload "X:/MyLisp/Objects.LSP" '("hio" "uniso" "iso"))

(autoload "X:/MyLisp/Occ.LSP" '("occ"))

 

Henrique

Edited by hmsilva
Posted

Hi,

 

That thing about file header, I thought it was irrelevant due to the semicolon but I already fixed it.

Let me ask you about something. I have to store the acaddoc.lsp in the Aplicationplugins folder or it must be only in one folder like support?

I'll try to do like you sad about the paths, let's se what happens.

Thank'u

Posted

That thing about file header, I thought it was irrelevant due to the semicolon but I already fixed it.

 

You are correct, it's irrelevant, my doubt was if it was just the header or the filename...

 

I have to store the acaddoc.lsp in the Aplicationplugins folder or it must be only in one folder like support?

 

Store in support, and test with findfile if is that one the file AutoCAD first find.

 

Henrique

Posted

I've done that and its fine. The fille in the support is the first.

 

Ok, everthung is done and iven so the same lisps doen't load automatically. I've made a routine that load the funtions I need and put in a button everytime I need them I push the button and it works.

I''ll fo on like that until I found what's wrong.

Thank you all guys. Your attention help me much despite that issue but it make me learn much.

Posted

You're welcome, Luancat!

 

 

If necessary, and easier for you, you may PM me in Portugês...

 

 

Henrique

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...