Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
How to select text related to Direction X?
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: How to select text related to Direction X? (Read 1647 times)
0 Members and 1 Guest are viewing this topic.
HasanCAD
Swamp Rat
Posts: 1423
How to select text related to Direction X?
«
on:
November 09, 2015, 08:09:44 AM »
I want to code a lisp to calculate sum of numbers and but the result at right.
For one row it is OK but i am wondering if there are more than one row, how to sum each row in separate?
Edit: Adding pic
«
Last Edit: November 09, 2015, 08:16:59 AM by HasanCAD
»
Logged
Sorry for my English.
Donate to Theswamp
www.sergiwa.com
Lee Mac
Seagull
Posts: 12929
London, England
WWW
Re: How to select text related to Direction X?
«
Reply #1 on:
November 09, 2015, 08:51:53 AM »
This example
should point you in the right direction
Logged
Lee Mac Programming
•
Twitter
•
Exchange App Store
HasanCAD
Swamp Rat
Posts: 1423
Re: How to select text related to Direction X?
«
Reply #2 on:
November 15, 2015, 03:33:09 AM »
this what i coded but not working
- How to sort?
- How to delete first item in list to ?
Code - Auto/Visual Lisp:
[Select]
(
defun
c:rt
(
/
ent inc lst sel srt
D P P2 ST T1 T1S T1X T1Y T2 T2S T2X T2Y
)
(
defun
LM:TextInsertion
(
elist
)
;lee
(
if
(
or
(
eq
"MTEXT"
(
cdr
(
assoc
0
elist
)
)
)
(
and
(
zerop
(
cdr
(
assoc
72
elist
)
)
)
(
zerop
(
cdr
(
assoc
73
elist
)
)
)
)
)
(
cdr
(
assoc
10
elist
)
)
(
cdr
(
assoc
11
elist
)
)
)
)
(
if
(
setq
sel
(
ssget
"_:L"
'
(
(
0
.
"MTEXT,TEXT"
)
)
)
)
(
progn
(
setq
lst
nil
)
(
setq
st
0
)
(
repeat
(
setq
inc
(
sslength
sel
)
)
(
setq
ent
(
entget
(
ssname
sel
(
setq
inc
(
1-
inc
)
)
)
)
)
(
setq
p
(
LM:TextInsertion ent
)
)
; get txt coord.
(
setq
d
(
list
(
nth
1
p
)
(
nth
0
p
)
(
cdr
(
assoc
1
ent
)
)
)
)
(
setq
lst
(
cons
d lst
)
)
)
(
setq
lst
(
vl-sort
lst
(
function
(
lambda
(
a b
)
(
<
(
car
a
)
(
car
b
)
)
)
)
)
)
;How to sort
(
while
lst
(
setq
t1
(
nth
0
lst
)
)
(
setq
t1x
(
nth
0
t1
)
)
(
setq
t1y
(
nth
1
t1
)
)
(
setq
t1s
(
nth
2
t1
)
)
(
setq
t2
(
nth
1
lst
)
)
(
setq
t2x
(
nth
0
t2
)
)
(
setq
t2y
(
nth
1
t2
)
)
(
setq
t2s
(
nth
2
t2
)
)
(
if
(
=
t1x t2x
)
(
progn
(
setq
st
(
+
st
(
atof
t1s
)
(
atof
t2s
)
)
)
(
setq
p2
(
list
t1x t1y
0
)
)
(
ssdel
t1 lst
)
; How to delete
)
(
progn
(
setq
st
(
+
st
(
atof
t1s
)
)
)
(
setq
p2
(
list
(
+
1000
t1x
)
t1y
0
)
)
(
vl-cmdf
"text"
"j"
"R"
p2
"0.0"
st
)
(
ssdel
t1 lst
)
; How to delete
)
)
)
)
)
)
Logged
Sorry for my English.
Donate to Theswamp
www.sergiwa.com
HasanCAD
Swamp Rat
Posts: 1423
Re: How to select text related to Direction X?
«
Reply #3 on:
November 16, 2015, 09:36:42 AM »
eeeemmmmm
is there no solution?!?!?!?
Logged
Sorry for my English.
Donate to Theswamp
www.sergiwa.com
ChrisCarlson
Guest
Re: How to select text related to Direction X?
«
Reply #4 on:
November 16, 2015, 09:42:37 AM »
You asked a question on a weekend, give it some time.
Logged
HasanCAD
Swamp Rat
Posts: 1423
Re: How to select text related to Direction X?
«
Reply #5 on:
November 16, 2015, 09:57:48 AM »
Quote from: ChrisCarlson on November 16, 2015, 09:42:37 AM
You asked a question on a weekend, give it some time.
OOPS Sorry for that. Weekend finished here.
Logged
Sorry for my English.
Donate to Theswamp
www.sergiwa.com
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
AutoLISP (Vanilla / Visual)
»
Topic:
How to select text related to Direction X?