through Lisp i want to add civil 3d pipe structure lable

through Lisp i want to add civil 3d pipe structure lable

ganeshkumar_duraisamyGAGVW
Explorer Explorer
206 Views
2 Replies
Message 1 of 3

through Lisp i want to add civil 3d pipe structure lable

ganeshkumar_duraisamyGAGVW
Explorer
Explorer

i was trying to write using command  function of civil 3d command when it comes to the selection object which i select through lisp of (ssget function) it is not taking
i request you to suggest me.

defun c:3dlabel()
(vl-load-com)
  (command "osmode" "0")
  (command "cmdcho" "0")
  (setq cnt 0)
  (setq structureset (ssget '((0 . "AECC_STRUCTURE"))));ADDNETWORKPARTPLANLABEL
  (if (/= structureset nil)
    (progn
      (setq totalcnt (sslength structureset))
      (while (>= totalcnt totalcnt)
(setq structure_obj (ssname structureset cnt));(vlax-ename->vla-object
(setq c3dobj (vlax-ename->vla-object structure_obj))
(setq strc_coord (vlax-ename->vla-object structure_obj))
;;; (command "")
(command "_AeccAddNetworkPartPlanLabel" c3dobj "")
 
;;; (setq strc_xy (vlax-get-property strc_coord 'Position))
;;; (command "ADDNETWORKPARTPLANLABEL" structure_obj)
;;; (setq sellab_Obj (entlast))
;;; (setq newlabpt1 (getpoint "\n Pick point to align.."))
;;; (setq newlabpt (getpoint newlabpt1 "\n Pick point to align.."))
 
;;; (command "stretch" structure_obj "" (setq basept1(getpoint)) (getpoint basept1))
(setq cnt (1+ cnt))
)
      )
    )
  (command "osmode" "0")
  (princ)
  )
0 Likes
207 Views
2 Replies
Replies (2)
Message 2 of 3

hosneyalaa
Advisor
Advisor
0 Likes
Message 3 of 3

Moshe-A
Mentor
Mentor

@ganeshkumar_duraisamyGAGVW hi,

 

Do not have civil 3d but check this.

 

Moshe

 

(vl-load-com) ; load activex support

(defun c:3dlabel (/ savOSmode structureset structure_obj ;| local variables |; )
 (command "cmdcho" "0")
 (command "._undo" "_begin")

 (setq savOSmode (getvar "osmode"))
 (setvar "osmode" 0)
  
 (if (setq structureset (ssget '((0 . "AECC_STRUCTURE")))) ;ADD NETWORK PART PLAN LABEL
  (progn
    
   (foreach structure_obj (vl-remove-if 'listp (mapcar 'cadr (ssnamex structureset)))
    (command "_AeccAddNetworkPartPlanLabel" structure_obj "")
 
    ;;; (command "ADDNETWORKPARTPLANLABEL" structure_obj)
    ;;; (setq sellab_Obj (entlast))
    ;;; (setq newlabpt1 (getpoint "\n Pick point to align.."))
    ;;; (setq newlabpt (getpoint newlabpt1 "\n Pick point to align.."))
 
    ;;; (command "stretch" structure_obj "" (setq basept1(getpoint)) (getpoint basept1))
     
   ); foreach
   
  ); progn
 ); if
  
 (setvar "osmode" savOSmode)

 (command "._undo" "_end")
 (setvar "cmdecho" 1)
  
 (princ)
); c:3dlabel

 

 

0 Likes