Jump to content

Recommended Posts

Posted (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 by ScottMC
visability
Posted

'CurrentVertex' is not a property of "LWPOLYLINE" objects

Posted

no show/difference with a 'CONVERTPOLY Enter polyline conversion option [Heavy/Light] <Light>: h'

2d polyline..

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...