ScottMC Posted 20 hours ago Posted 20 hours ago (edited) here's the AI reply to my question: "Activate Current Vertex 'X' marker: as if Clicking on the Current Vertex field on gis Properties, autolisp" here's the code and tried but my a2k might not be able.. can someone try this <short>Vertex.X.lsp? (defun c:Sv ( / ent obj vla-obj vertexNum) (vl-load-com) ;; 1. Select the polyline (setq ent (car (entsel "\nSelect Polyline: "))) (if (and ent (member (cdr (assoc 0 (entget ent))) '("LWPOLYLINE" "POLYLINE"))) (progn (setq vla-obj (vlax-ename->vla-object ent)) ;; 2. Ask for the vertex index (0-indexed) (setq vertexNum (getint "\nEnter vertex index (0 is first): ")) ;; 0) ;; <- my choice (if (and vertexNum (>= vertexNum 0)) (progn ;; 3. Set the CurrentVertex property (Activates the X marker) (vl-catch-all-apply 'vlax-put-property (list vla-obj 'CurrentVertex vertexNum)) ;; 4. Refresh to show the marker (vla-update vla-obj) (redraw) (princ (strcat "\nVertex " (itoa vertexNum) " activated.")) ) ) ) (princ "\nNot a valid polyline.") ) (princ) ) Edited 1 hour ago by SLW210 Added Code Tags!!! Quote
GLAVCVS Posted 19 hours ago Posted 19 hours ago 'CurrentVertex' is not a property of "LWPOLYLINE" objects Quote
ScottMC Posted 19 hours ago Author Posted 19 hours ago no show/difference with a 'CONVERTPOLY Enter polyline conversion option [Heavy/Light] <Light>: h' 2d polyline.. Quote
BIGAL Posted 15 hours ago Posted 15 hours ago You can get all vertices step 1, Step 2 is enter vertice number place a "X" say as text on vertice. If wrong do again erasing existing "X". An example of get co-ords. (setq plent (entsel "\nPick lwpolyline 2D ")) (if plent (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget (car plent)))))) (princ co-ord) If you have 3D poly's then use (setq obj (vlax-ename->vla-object (car (entsel "\nPick pline ")))) (setq co-ord (vlax-safearray->list (vlax-variant-value (vla-get-coordinates obj)))) Quote
ScottMC Posted 11 hours ago Author Posted 11 hours ago Re.. the point is to get AutoCAD to perform the Properties vertex highlight but I'm probably correct to say 'they wouldn't prefer. Just is a single click on the Properties/Vertex and up.it.pops. Such a minor benefit but would choose yes if asked. Here's one from the many [matrix..] that does help me. It's from MR Marko Ribar - with other updates.. https://forums.augi.com/showthread.php?125388-End-of-foreach-function But here's my mod of it. CHIV-StartPoint.lsp Quote
SLW210 Posted 1 hour ago Posted 1 hour ago Please use Code Tags for your code in the future. (<> in the editor toolbar) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.