Updating Lisps

Updating Lisps

FORBESWILSON6174
Advocate Advocate
1,363 Views
11 Replies
Message 1 of 12

Updating Lisps

FORBESWILSON6174
Advocate
Advocate

I have found someone who is having a look at updating some steel section lisps I used before the Cuix menu system came into being. I have just gone back and have tried to run the lisps, but when I load them, I get an error message:-

(load "Rotang") ; error : syntax error

The lisps run up the the end routine which is the 'Rotang' lisp and then obviously bombs out.

While I can follow how the lisps work, unfortunately I don't have the brain power to sort the problem out.

I have attached the two lisps, although there are others that go through the same end routine, and the mnu file for reference.

 

Please can someone help.

0 Likes
Accepted solutions (1)
1,364 Views
11 Replies
Replies (11)
Message 2 of 12

Anonymous
Not applicable

Rotang is written like this:

 

;-----------------------Rotang-------------------------
;Lisp routine to determine angular position
    (defun ROTANG (initget PT1 (getpoint "\nInsertion Point: "))      ;Insertion Point
                  (setq p2 (getpoint pt1 "\nSecond Point: "))
                       (setq ang (angle pt1 p2))
       )    

It would be like this ?

 

(defun c:ROTANG (/ p1 p2 ang )
  (setq p1  (getpoint "\nInsertion Point: ")
	p2  (getpoint pt1 "\nSecond Point: ")
	ang (angle pt1 p2)
  )
)
0 Likes
Message 3 of 12

cadffm
Consultant
Consultant

Menu

You can import parts of your mnu file to a new custom cuix, load them as partial cuix.

Lisp

This works in the past, REALLY?

If someone can explain it, your welcome.

 

For me, it should looks more like this, or?

;-----------------------Rotang-------------------------
;Lisp routine to determine angular position
(defun ROTANG ()
(initget 1)
(setq PT1 (getpoint "\nInsertion Point: ")) ;Insertion Point
(initget 1)
(setq p2 (getpoint pt1 "\nSecond Point: "))
(setq ang (angle pt1 p2))
) ;En

 

PS: It is absolutely useless to start a command with an underline when  following commands and options are called by local names.

(command "_layer" "co" 8 "0" "")

"_layer", international call, works well

"co" Crashes depending of used local language pack.

 

 

But with just the half code, we can not know it.

 

UnbenanntSTEEL1.png

 

 

i am out.

 

Sebastian

0 Likes
Message 4 of 12

cadffm
Consultant
Consultant

@Anonymous  schrieb:

It would be like this ?

 

(defun c:ROTANG (/ p1 p2 ang )
  (setq p1  (getpoint "\nInsertion Point: ")
	p2  (getpoint pt1 "\nSecond Point: ")
	ang (angle pt1 p2)
  )
)

Sure not.

1. It is called (rotang) in the other file, so use defun instead to define a command by defun c:

2. It is called (rotang) , so ANG habe to be GLOBAL, not an local variable

   And that because i didn't used local variables, because i didn't know if p1 and p2 are used in other parts.

   I guess: Sure not, only ANG, but i can't know it with the cheking all files.

 

LG Sebastian

Sebastian

Message 5 of 12

Anonymous
Not applicable

Will be? 🤔
I did not understand!! 😅 🤗

0 Likes
Message 6 of 12

FORBESWILSON6174
Advocate
Advocate

Thanks for both the replies, however neither of them allow for rotation after insertion.

Betreff, if you open the mnu file and scroll down, you will find the command line that activates the lisp.

Please excuse me, I know very little about lisps, that is why I am posting on the forum.

0 Likes
Message 7 of 12

cadffm
Consultant
Consultant

Hello RE:

i don't know what you mean with "however neither of them allow for rotation after insertion"

because WE (all others, except you) don't know the content of your other lisp files.

 

>"Betreff, if you open the mnu file and scroll down, you will find the command line that activates the lisp."

Yes, "START" "Rsangle" "CHL1"  "Beam" "PG"  "CHL" "Rsangle" "Rotang" <= loaded RSANGLE 2x, comes from your mnu, not my mistake.

Also to re-load a file by every use of the menu.. but ok. it works, it isn't a problem, just not a smart solution.

I know this, i can read (and understand) these lines clearly.

 

>"Please excuse me, I know very little about lisps, that is why I am posting on the forum."

If you want to find anyone who does it for you, whether it's paid or for fun, he'll need the files.

Sebastian

0 Likes
Message 8 of 12

Kent1Cooper
Consultant
Consultant

The replacement of initget with setq that @Anonymous suggested is appropriate, but not  the addition of the c: to the name -- that would make it a command that must be called for at the Command prompt, but the use of it in the enclosing RSANGLE routine is in the form of a function or sub-routine, for which the c: is not appropriate.

Kent Cooper, AIA
Message 9 of 12

cadffm
Consultant
Consultant

And because rotang is called without arguments, my try from answer above looks like

 

For me, it should looks more like this, or?

;-----------------------Rotang-------------------------
;Lisp routine to determine angular position
(defun ROTANG ()
  (initget 1)
  (setq PT1 (getpoint "\nInsertion Point: ")) ;Insertion Point
  (initget 1)
  (setq p2 (getpoint pt1 "\nSecond Point: "))
  (setq ang (angle pt1 p2))
) ;En

 

Without knowing the code of (PLACE)   and  (ENDR), thats the best way i am thinking.

But it also not works in any older versions that a secret of ForbesWilsion.

Sebastian

0 Likes
Message 10 of 12

FORBESWILSON6174
Advocate
Advocate

I thank you all for your replies, but It is getting more confusing. As can be seen, from the mnu file the lisps are loaded, and from the pull-down a member size can be selected which populates the lisp. In the Rsangle lisp file, there is an end routine which orientates the inserted member. It is during the end routine that everything falls apart. 

I can provide all the lisps with pleasure if it will help. I only posted one lisp, because the other lisps have the same end routine.

0 Likes
Message 11 of 12

FORBESWILSON6174
Advocate
Advocate

You don't have to load the lisps every time, you can load them on start up or the first time you want to use them, that is all.

Regards,

0 Likes
Message 12 of 12

cadffm
Consultant
Consultant
Accepted solution

Nobody can test these things,

START routine; unknown

ENDR routine; unknown

 

[F1] - To Start Debugging a Program (Visual LISP IDE)

 

 

Sebastian

0 Likes