Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Looking for entsel replacement

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
ksmith84
1441 Views, 19 Replies

Looking for entsel replacement

I've been working for hours on trying to incorporate a selection set called out previously in this script, but if I replace the code:

 

(defun c:TTG3 ()
(entmod
(DeleteVertexAt
(entget (setq en (car (entsel))))
3
)))

 

...with anything related to "W" p3 p4 '((0 . "*POLYLINE)) or the like, even if the code works on other parts, there is a 'nil' or malformed list error.  I need this portion of the code to recall p3 and p4 and select only polylines from it. The script has to perform "DeleteVertexAt" until all selected polylines have been accounted for.

 

The original code for "TTG3" is here http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Deleteing-polyline-vertex/td-p/871485. But I am incorporating it into a large 3 part script, the first two recall p1 and p2 effortlessly, what is making the portion above lose p3 and p4 also?

 

Attached is a copy of the overall code.

 

The goal:
When TTG3 can run in loop until all the selected polylines have been touched /once/, then a final code will be added to reflect TTG1.


~¤~
^C^CMoonwalk
19 REPLIES 19
Message 2 of 20
fenton.webb
in reply to: ksmith84

Can you explain again what you need please? Please show me the end result of what this text means in your original post:

 

>>>>>>>>>

but if I replace the code:

 

(defun c:TTG3 ()
(entmod
(DeleteVertexAt
(entget (setq en (car (entsel))))
3
)))

 

...with anything related to "W" p3 p4 '((0 . "*POLYLINE)) or the like

<<<<<<<<<<<<<<<




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 20
ksmith84
in reply to: fenton.webb

Thank you for the swift reply!  The purpose to the code of 'TTG3' is to remove an extraneous vertex generated by 'txtexp' from Express tools. The Region command will not recognize overlapping polylines and thus not generate a region needed to create the final product. TTG3 has to be run and has to recognize all polylines within a set window selection area to make this happen.  The code must only run once before moving to 'TTG4' (to be added, see below).

---

 

Overall, the code has to Explode/region/unite bold text (TTG1), convert the left-over polylines on #4s (TTG2), then remove the extra vertex '4' (TTG3), and finally to be added another round of region/union/explode to finalize the process. I can get the last portion to work if TTG3 can recognize the polylines automatically and finish itself out.

---

 

Here's a screenshot of the text before and after the script is run. After the TTG2 portion has been run, the script somehow loses the selection sets that were made in the beginning. I understand the initial one of 'p1' and 'p2' are already reset, but shouldn't 'p3' and 'p4' still be in the memory since it was called out at the start?

---

 

(See attached JPG for this part)

I need the 'TTG3' portion of the lisp to automatically select the purple lines which overlap themselves.  I did a simple swap-out of the existing code of 'entsel' with a "W... polyline" code, but something keeps triggering a single-selection (however the filter being recognized by cad).

 

 

Thank you for any help n knowledge ya may have with this ^..^


~¤~
^C^CMoonwalk
Message 4 of 20
ksmith84
in reply to: ksmith84

Ok, got the code this far... It was working at one point but now I am stuck.  What is wrong with the code?

It was working at one point to convert the manually selected polylines to regions, but not union them to the other set.
All SS sets are lost after the third portion "TTG3" is run!


~¤~
^C^CMoonwalk
Message 5 of 20
fenton.webb
in reply to: ksmith84

Can I have the DWG file which is already at the point by which you run the TTG3 command please?




Fenton Webb
AutoCAD Engineering
Autodesk

Message 6 of 20
ksmith84
in reply to: fenton.webb

Use the lisp routine on this reply, the other one for some reason did not work even when I reloaded it on a new drawing.  The dwg file has descriptions on each step and where/when the problem occurs.  So can't wait til this code is complete.  Been working on this one issue for nearly 2 or 3 months now. Thank you again for taking a look.


~¤~
^C^CMoonwalk
Message 7 of 20
BlackBox_
in reply to: ksmith84


@ksmith84 wrote:

I've been working for hours on trying to incorporate a selection set called out previously in this script, but if I replace the code:

 

(defun c:TTG3 ()
(entmod
(DeleteVertexAt
(entget (setq en (car (entsel))))
3
)))

 

...with anything related to "W" p3 p4 '((0 . "*POLYLINE)) or the like, even if the code works on other parts, there is a 'nil' or malformed list error.  I need this portion of the code to recall p3 and p4 and select only polylines from it. The script has to perform "DeleteVertexAt" until all selected polylines have been accounted for.


Just a quick guess...

 

(defun _FOO (p3 p4 / ss i)
  (if (and DeleteVertexAt
           (setq ss (ssget "w" p3 p4 '((0 . "*POLYLINE"))))
      )
    (repeat (setq i (sslength ss))
      (entmod
        (DeleteVertexAt
          (entget (ssname ss (setq i (1- i))))
          3
        )
      )
    )
    (if (not DeleteVertexAt)
      (prompt
        (strcat "\n** Function \"DeleteVertexAt\" not defined ** ")
      )
    )
  )
  (princ)
)

 

[Edit] - ... And an even quicker example:

 

(defun c:FOO (/ p3 p4)
  (if (and (setq p3 (getpoint "\nSpecify oposite corner: "))
           (not (initget 32))
           (setq p4 (getcorner p3))
      )
    (_FOO p3 p4)
  )
  (princ)
)

 



"How we think determines what we do, and what we do determines what we get."

Message 8 of 20
ksmith84
in reply to: BlackBox_

BlackBox, trying the first code via c:_FOO returns a message saying "Too few arguments", leaving the code as shown typed it gives "no command definition". Am I placing it in the wrong spot?

 

UPDATE -

They work great! I was misinterpreting the code, but was able to call it correctly from the start script also. Going to work on getting the closing portion working.


~¤~
^C^CMoonwalk
Message 9 of 20
ksmith84
in reply to: BlackBox_

ok, this last part is driving me nuts. I can't get any other commands to recognize selections now.  The codes up to now work woderfully. But every place I embed or even add at the start, the region and union commands are not recognizing any ss callouts or fresh window callouts. >.<

 

I like what you did Blackbox, with the selection window. Can it be made to carry "ss" to region and union? This will finish out the script.


~¤~
^C^CMoonwalk
Message 10 of 20
BlackBox_
in reply to: ksmith84

I'm glad to hear I was able to offer some help; I'm not at my dev laptop now (posting from my iPhone), but will look into it tomorrow during m lunch break.

Cheers


"How we think determines what we do, and what we do determines what we get."

Message 11 of 20
ksmith84
in reply to: BlackBox_

Got it working! The script for Text To Geometry is complete finally!!


Thank you hundreds of times over to everyone that has been helping get this working over the past couple months!!


~¤~
^C^CMoonwalk
Message 12 of 20
BlackBox_
in reply to: ksmith84


@ksmith84 wrote:

Got it working! The script for Text To Geometry is complete finally!!


Thank you hundreds of times over to everyone that has been helping get this working over the past couple months!!


Congrats, ksmith84!

 

 

 

... Although, I should have thought to share these earlier *shrug* : 

 

http://apps.exchange.autodesk.com/ACD/en/List/Search?productline=ACD&query=seant&facet=&collection=

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Message 13 of 20
ksmith84
in reply to: BlackBox_

Haha true, and still appreciate the extra thought there. We have tried the 't2g' without success (currently running Autocad Mechanical 2009).

 

Again, thank you BlackBox and everyone else too (you too Mr. Lee)! My gratitude is limitless right now 😄


~¤~
^C^CMoonwalk
Message 14 of 20
BlackBox_
in reply to: ksmith84


@ksmith84 wrote:

Haha true, and still appreciate the extra thought there. We have tried the 't2g' without success (currently running Autocad Mechanical 2009).

 

Again, thank you BlackBox and everyone else too (you too Mr. Lee)! My gratitude is limitless right now 😄


No worries; that is kind of you to say.

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Message 15 of 20
AlwineCAD
in reply to: ksmith84

I tried to download this file but was blocked by a virus detector.

 

Message 16 of 20


@AlwineCAD wrote:

I tried to download this file but was blocked by a virus detector.

 


I am not getting any virus alerts when downloading this. A false positive perhaps?

 

Thanks
Discussion_Admin

Message 17 of 20


@Discussion_Admin wrote:

@AlwineCAD wrote:

I tried to download this file but was blocked by a virus detector.

 


I am not getting any virus alerts when downloading this. A false positive perhaps?

 

Thanks
Discussion_Admin


@Discussion_Admin -  

 

You're replying to a post from three years ago. Haha

 

Cheers

 

 

~ Thread officially zombified.



"How we think determines what we do, and what we do determines what we get."

Message 18 of 20
BlackBox_
in reply to: BlackBox_


@BlackBox_ wrote:

 

... Although, I should have thought to share these earlier *shrug* : 

 

http://apps.exchange.autodesk.com/ACD/en/List/Search?productline=ACD&query=seant&facet=&collection=

 

Cheers


For those who may be interested, here's an updated App .bundle, which now supports 2017:

 

http://www.cadtutor.net/forum/showthread.php?90737-Text-To-Geometry-2015-Testing&p=661415&viewfull=1...

 

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Message 19 of 20

Message 20 of 20

No worries, @Discussion_Admin Haha; it gave me a reason to post an updated link to a friend's great work, and for that, I thank you. :beer:

 

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost