find text & use in programme

find text & use in programme

Anonymous
Not applicable
1,489 Views
11 Replies
Message 1 of 12

find text & use in programme

Anonymous
Not applicable

I have attached lisp programme. In which I manually select the text to arrange it in sequence. But in my drawing I am selecting the text only which have prefix "TBA-" So is it possible to update my existing programme for automatic selection of text which consist of prefix "TBA-" instead of selecting them manually. This will reduce my lots of time. Thanks!

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

ВeekeeCZ
Consultant
Consultant

Try to replace this part

(ssget '((0 . "TEXT") (1 . "*-*")))

 

with this:

(ssget "_X" (list (0 . "TEXT") (1 . "TBA-*") (cons 410 (getvar 'CTAB))))

 

Otherwise you could kindly ask the author.

0 Likes
Message 3 of 12

Anonymous
Not applicable

Thanks for the solution. I tried this but it shows error that "no function definition: GETLST". Please refer attached updated program. Is it correctly updated?

0 Likes
Message 4 of 12

dbhunia
Advisor
Advisor

Hi Archana,

 

Try the attached code......

 

At the time of execution of code, if you don't want to move the selected text then press "Esc" once to deselect the text and press "Enter" to continue with next text. To terminate the execution of code at any stage press "Esc" twice.

 

Debashis


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 5 of 12

Anonymous
Not applicable

Hello Debashis, Thanks for the code! But my requirement is different. Please refer attached test.dwg file for exact requirement.

0 Likes
Message 6 of 12

dbhunia
Advisor
Advisor

@Anonymous wrote:

I have attached lisp programme. In which I manually select the text to arrange it in sequence. But in my drawing I am selecting the text only which have prefix "TBA-" So is it possible to update my existing programme for automatic selection of text which consist of prefix "TBA-" instead of selecting them manually. This will reduce my lots of time. Thanks!


 

Hi Archana,

 

I have resolved the selection problem......

 

hopefully you can sort out the rest ........  

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 7 of 12

Anonymous
Not applicable

Thanks for your prompt reply! It is working but while inserting the final result, it insert first one box then on next click it insert 1st & 2nd box, then on next click it insert 1st,2nd &3rd box, likewise. I want all boxwes only in one click. Please help!

0 Likes
Message 8 of 12

ВeekeeCZ
Consultant
Consultant

@Anonymous wrote:

Thanks for the solution. I tried this but it shows error that "no function definition: GETLST". Please refer attached updated program. Is it correctly updated?


 

Sorry, my bad, it should be:

(ssget "_X" (list '(0 . "TEXT") '(1 . "TBA-*") (cons 410 (getvar 'CTAB))))

That should resolve your "no function definition" issue.

0 Likes
Message 9 of 12

dbhunia
Advisor
Advisor

ok I will give me some time......


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 10 of 12

dbhunia
Advisor
Advisor

@Anonymous wrote:

Thanks for your prompt reply! It is working but while inserting the final result, it insert first one box then on next click it insert 1st & 2nd box, then on next click it insert 1st,2nd &3rd box, likewise. I want all boxwes only in one click. Please help!


 

Hi Archana,

 

Try this code.....

(It has been tested in "AutoCAD 2007", hope fully it will work in latest version. Otherwise you have to wait till Monday)

 

 

 

 


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....
0 Likes
Message 11 of 12

Anonymous
Not applicable

Thank you very much! It works!

0 Likes
Message 12 of 12

dbhunia
Advisor
Advisor
Accepted solution

@Anonymous wrote:

Thank you very much! It works!


 

Hi Archana,

 

If it is Working then Accept the solution....


Debashis Bhunia
Co-Founder of Geometrifying Trigonometry(C)
________________________________________________
Walking is the First step of Running, Technique comes Next....