flopo 发表于 2022-7-6 09:37:04

Thanks guys!
Stefan, i think your first variant is exactly what i was asking for. But i will try both solutions you gave me.

alanjt 发表于 2022-7-6 09:41:18

That's a lot of variables you won't be able to localize. Use this list; much cleaner and faster.

pBe 发表于 2022-7-6 09:43:22

 
The way i read your code is you already have p1,p2,p3... variables and you need to create a new variable based on whats already defined.
p1...p99
cota
pcota
 
A sub like the one i posted will create a new variable, and with the proper code you localized that 1 varaible, as a matter of fact you dont even need to assigned it to an unknown variable name.
 
(setq NewVal (MakeVar ....))
 
I used a list as the argument for member(the variable this), i would suggest testing number of pt*variables(which by my understanding are already defined)and use that as the TTL arg, where
lst is pcota
num2addas cota
 
I dont know your reason for creating points but take Alanjts advice and use a list
as the the final result rather than unknown number of variables:
 
((1.0 2.0. 3.0)(2.0 4.0 5.0)(2.0 4.0 5.0))
instead of
p1
p2
p3
 
but this:
(setq pz8 (rtos(+ cota (- (cadr p8 (cadr pcota)))2 2 ))).. is not creating a point value but a string value
 
Anyway. Hope this helps..
页: 1 [2]
查看完整版本: lisp help - while