Point Creation Parameters

Point Creation Parameters

Anonymous
Not applicable
926 Views
7 Replies
Message 1 of 8

Point Creation Parameters

Anonymous
Not applicable

Hi, Does anyone know how to edit the point creation parameters in lisp, more specifically Prompt for elevations, prompt for point names, prompt for descriptions, default elevation and default description.??? I'd like to change these parameters occasionally depending on what Program I'm running. Thanks in advance.

Rick48JA7_0-1623967869447.png

 

0 Likes
Accepted solutions (1)
927 Views
7 Replies
Replies (7)
Message 2 of 8

Jeff_M
Consultant
Consultant

Sure:

(setq c3d (getaeccapp "Land"));;previously posted this function
(setq c3ddoc (vlax-get c3d 'activedocument))
(setq settings (vlax-get c3ddoc 'settings)
      ptcmdsettings (vlax-get settings 'pointcommandssettings)
      createptsettings (vlax-get ptcmdsettings 'createpointssettings)
      ptcreationsettings (vlax-get createptsettings 'pointcreationsettings))
(setq descprompt (vlax-get ptcreationsettings 'promptfordescriptions)
      elevprompt (vlax-get ptcreationsettings 'promptforelevation)
      descdefault (vlax-get ptcreationsettings 'defaultdescription)
      elevdefault (vlax-get ptcreationsettings 'defaultelevation)
      )
;;promptfordescriptions and promptforelevation values
;; 0 = Automatic
;; 1 = Automatic-Object (not used for elevation)
;; 2 = Manual
;; 3 = None

;;example to set any of these settings:
(vlax-put descprompt 'value 0)
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 8

Anonymous
Not applicable

Thanks for the code I always do try and search for this kind of stuff before I ask for help. So this is my program so far.

 

(vl-load-com)
(defun c:cc (/ ent1 oldlay c3d c3ddoc settings ptcmdsettings createptsettings ptcreationsettings descprompt elevprompt descdefault elevdefault nameprompt)
(setq c3d (getaeccapp "Land"))
(setq c3ddoc (vlax-get c3d 'activedocument))
(setq settings (vlax-get c3ddoc 'settings)
ptcmdsettings (vlax-get settings 'pointcommandssettings)
createptsettings (vlax-get ptcmdsettings 'createpointssettings)
ptcreationsettings (vlax-get createptsettings 'pointcreationsettings))
(setq descprompt (vlax-get ptcreationsettings 'promptfordescriptions)
elevprompt (vlax-get ptcreationsettings 'promptforelevation)
descdefault (vlax-get ptcreationsettings 'defaultdescription)
elevdefault (vlax-get ptcreationsettings 'defaultelevation)
nameprompt (vlax-get ptcreationsettings 'promptforpointnames)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ "\nPick your Line ... ")
(setq ent1 (car (entsel)))
(setq oldlay (cdr (assoc 8 (entget ent1))))
(vlax-put elevprompt 'value 0)
(vlax-put nameprompt 'value 0)
(vlax-put descprompt 'value 0)
(vlax-put elevdefault 'value "0")
(vlax-put descdefault 'value oldlay)
(command "-CREATEPOINTMEASUREOBJECT" ********* "" "" "" "50")
)

 

Where I have the ******** is where I need to place the line entity that was selected above with entsel. I

I just want to select the line I want then it puts points every 50 feet with elevation of 0 and desc of layer name using create point measure object. Ideally I want to select a bunch of lines on diffrent layers and add point to all of them every 50 feet but the point code desc must be the layer that that line is on.

Thanks in advance

 

 

 

0 Likes
Message 4 of 8

Anonymous
Not applicable

This is what I have so far.

(vl-load-com)
(defun c:cc (/ ent1 oldlay settings ptcmdsettings createptsettings ptcreationsettings descprompt elevprompt descdefault elevdefault nameprompt)
(setq c3d (getaeccapp "Land"))
(setq c3ddoc (vlax-get c3d 'activedocument))
(setq settings (vlax-get c3ddoc 'settings)
ptcmdsettings (vlax-get settings 'pointcommandssettings)
createptsettings (vlax-get ptcmdsettings 'createpointssettings)
ptcreationsettings (vlax-get createptsettings 'pointcreationsettings))
(setq descprompt (vlax-get ptcreationsettings 'promptfordescriptions)
elevprompt (vlax-get ptcreationsettings 'promptforelevation)
descdefault (vlax-get ptcreationsettings 'defaultdescription)
elevdefault (vlax-get ptcreationsettings 'defaultelevation)
nameprompt (vlax-get ptcreationsettings 'promptforpointnames)
)
;; 0 = Automatic
;; 1 = Automatic-Object (not used for elevation)
;; 2 = Manual
;; 3 = None
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(princ "\nSelect your Lines ... ")
(while (setq SS (ssget '((0 . "*line"))))
(setq i -1)
(while (setq pt (vlax-ename->vla-object (ssname SS (setq i (1+ i)))))
(setq ent1 (car (entsel)))
(setq oldlay (cdr (assoc 8 (entget ent1))))
(vlax-put elevprompt 'value 0)
(vlax-put nameprompt 'value 0)
(vlax-put descprompt 'value 0)
(vlax-put elevdefault 'value "0")
(vlax-put descdefault 'value oldlay)
(command "-CREATEPOINTMEASUREOBJECT" **** "" "" "" "50" "")
(command "-CREATEPTPLYLNCTRVERTAUTO" **** "")
);end of while
);end of while
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;end of loop here
(vlax-put elevprompt 'value 2)
(vlax-put nameprompt 'value 3)
(vlax-put descprompt 'value 2)
(vlax-put elevdefault 'value "0")
(vlax-put descdefault 'value 3)
)

 

 

0 Likes
Message 5 of 8

Jeff_M
Consultant
Consultant

@Anonymous it looks like C3D 'commands' are not defined to allow you to call them from lisp. 

(command "_AeccCreatePointMeasureObject " (ssname ss 0) "" "" "" "50" "")
_AeccCreatePointMeasureObject Unknown command "AECCCREATEPOINTMEASUREOBJECT ".

 

So create your own tool to add points along an object at the specified interval. Something like this:

(defun c:createpointsoncurve
       (/ c3d C3DDOC COGOPT CRV DIST I LEN OLDLAY PNTS PT SS)
  (setq c3d (getaeccapp "Land"))
  (setq c3ddoc (vlax-get c3d 'activedocument))
  (setq pnts (vlax-get c3ddoc 'points))
  (setq dist 50.0);;edit this or add a (getdist) prompt here
  (while (setq SS (ssget '((0 . "*line"))))
    (setq i -1)
    (while (setq ent (ssname SS (setq i (1+ i))))
      (setq crv (vlax-ename->vla-object ent)
	    oldlay (vla-get-layer crv))
      (setq len (* -1 dist))
      (while
	(< (setq len (+ len dist))
	   (vlax-curve-getdistatpoint crv (vlax-curve-getendpoint crv))
	)
	 (setq pt     (vlax-curve-getpointatdist crv len)
	       cogopt (vlax-invoke pnts 'add pt)
	 )
	 (vlax-put cogopt 'rawdescription oldlay)
      )
    )
  )
  (princ)
)
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 6 of 8

Anonymous
Not applicable

Hey Jeff, yes I had thought about that concept of just doing my own without using that cumbersome measure point feature. This code works great, now if I wanted to also add a single point at the end of each polyline as well to define the polyline from start to finish would I just createpointmanual or vlax-curve-getendpoint somehow??? 

 

0 Likes
Message 7 of 8

Jeff_M
Consultant
Consultant
Accepted solution

Sorry, @Anonymous , I was out of town for a few days. Yes, to add the point at the end of the polyline just do so after the (while (< len ...) loop ends.

      	 (setq pt     (vlax-curve-getendpoint crv)
	       cogopt (vlax-invoke pnts 'add pt)
	 )
	 (vlax-put cogopt 'rawdescription oldlay)
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 8 of 8

Anonymous
Not applicable

Thanks Jeff I figured it was something easy to add on. 

0 Likes