See the top rated post in this thread. Click here

Results 1 to 9 of 9

Thread: How to set the Point Style for a Civil 3d Cogo Point?

  1. #1
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    450
    Login to Give a bone
    0

    Default How to set the Point Style for a Civil 3d Cogo Point?

    How can I set the point style for a Civil 3d Cogo Point? I am currently copying the style from another point but I would rather not do this because the style may not be assigned to point when I first use the lisp.

    If I do a dump I can see the name of the style is #<VLA-OBJECT IAeccPointStyle 00000243056af840>

    How do I set VLA_OBJECT... to a variable?

    Code:
    (defun c:pm_two_arrow (/)
        (initerr)
        (vl-load-com)
        
        (setq acaddocument (vla-get-activedocument (vlax-get-acad-object)))
        (setq mspace (vla-get-modelspace acaddocument))
        (setq sourcept (vlax-ename->vla-object (car (entsel "\nSelect Source Survey Point: "))))
        ;;I would like to remove the line below
        (setq destpt (vlax-ename->vla-object (car (entsel "\nSelect Destination Survey Point: "))))
        (setq pt1 (getpoint "\nPick Point 1 for Rotation: "))
        (setq pt2 (getpoint "\nPick Point 1 for Rotation: "))
        (setq ang (angle pt1 pt2))
        
        (setq ptstyle (vlax-get sourcept 'Style))
        ;Style = #<VLA-OBJECT IAeccPointStyle 00000243056af840>
        ;(setq new_pt_style ())
    
        ;(vlax-put pt 'Style ptstyle)
    
        (vlax-put-property destpt 'Style ptstyle)
        (vlax-put-property destpt 'Rotation ang)
    
        
        
        (reset)
        (princ)
    )
    (princ)
    Last edited by BlackBox; 2021-04-02 at 08:02 PM. Reason: Please use [CODE] Tags

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    0

    Default Re: How to set the Point Style for a Civil 3d Cogo Point?

    Here is a start and may be helpfull.

    HTML Code:
    ; create civ3d points example
    ; By Alan H 2019
    
    (vl-load-com)
    (if (not AH:vercheck)(load "vercheck"))
    (ah:vercheck)
    
    (defun c:psty ( / sty num ptnum ss x )
    (setq sty (getstring "\nEnter new style name "))
    (while (setq ss (ssget (list (cons 0 "Aecc_Cogo_point"))))
      (repeat (setq x (sslength ss))
        (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1)))))
        (setq ptnum  (vlax-get obj 'Number))
        (vlax-for Point (vlax-get-property *aeccDoc* "Points")
          (setq num  (vlax-get point 'Number))
          (if (= num ptnum)
            (vlax-put-property Point 'Style sty)
          )
        )
      )
    )
    )
    
    ; vercheck.lsp  version check for *aecc objects
    ; By Alan H
    
    (defun ah:vercheck ( / vrsn appstr)
    (vl-load-com)
    
    (setq acApp (vlax-get-acad-object))
      (setq	C3D (strcat "HKEY_LOCAL_MACHINE\\"
    		    (if	vlax-user-product-key
    		      (vlax-user-product-key)
    		      (vlax-product-key)
    		    )
    	    )
    	C3D (vl-registry-read C3D "Release")
    	C3D (substr
    	      C3D
    	      1
    	      (vl-string-search "." C3D (+ (vl-string-search "." C3D) 1))
    	    )
      )
    (setq *AeccDoc*(vla-getinterfaceobject
    			(vlax-get-acad-object)
    			(strcat "AeccXUiLand.AeccApplication." C3D)
    			)
    )
    (princ)
    )

  3. #3
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: How to set the Point Style for a Civil 3d Cogo Point?

    You would need to query the PointStyles property of the Civil 3D document for the point style you are wishing to use.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  4. #4
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    0

    Default Re: How to set the Point Style for a Civil 3d Cogo Point?

    Like Opie 'PointlabelStyles
    Last edited by BIG-AL; 2021-04-06 at 12:23 AM.

  5. #5
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: How to set the Point Style for a Civil 3d Cogo Point?

    Quote Originally Posted by BIG-AL View Post
    Like Opie 'PointlabelStyles
    Yea. That's what I meant.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  6. #6
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    450
    Login to Give a bone
    0

    Default Re: How to set the Point Style for a Civil 3d Cogo Point?

    Sorry for the delay...

    When I run BIG AL's code I get an error
    Code:
    ; error: ActiveX Server returned the error: unknown name: Point
    It is running into an error on this line
    Code:
    (vlax-for Point (vlax-get-property *aeccDoc* "Points")
    and I am having trouble understanding what that line does.

    I don't want to modify the PointLabelStyle, I want to modify the PointStyle.

  7. #7
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    1

    Default Re: How to set the Point Style for a Civil 3d Cogo Point?

    Mixing pointstyle and labelstyle does not help, think I got it right now.

    Code:
    ; change a pt style not labelstyle 
    ; by Alanh April 2021
    
    ; Thanks to Alan j Thompson for listselect.lsp
    
    ; for any one the style name is not the simple description eg PSM = #<VLA-OBJECT IAeccPointStyle 000001f89e718b20>
    
    (vl-load-com)
    
    (if (not AH:vercheck) (load "vercheck"))
    (AH:vercheck)
    
    (while (setq ss (ssget (list (cons 0 "Aecc_Cogo_point"))))
    
    (setq lst '())
    (vlax-for i (vlax-get *AeccDoc* 'Pointstyles)
      (setq lst (cons (cons (vla-get-name i) i) lst))
    )
    
    (if (not AT:ListSelect)(load "listselect"))
    
    (setq ptsty (car (AT:ListSelect
                                        "Set new Point style"
                                        "Select style"
                                        10
                                        10
                                        "false"
                                        (mapcar (function car) lst)
                                      ) )
    )
    
    (foreach code lst
    (if  (= (car code) ptsty)
    (setq pstyle (cdr code)) 
    )
    )
    
    (repeat (setq x (sslength ss))
           (setq obj (vlax-ename->vla-object (ssname ss (setq  x (- x 1)))))
    		(vlax-put-property obj  'Style pstyle) 
    )
    
    )
    Attached Files Attached Files

  8. #8
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    1

    Default Re: How to set the Point Style for a Civil 3d Cogo Point?

    Quote Originally Posted by BIG-AL View Post
    Like Opie 'PointlabelStyles
    So I was right the entire time?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  9. #9
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    450
    Login to Give a bone
    0

    Default Re: How to set the Point Style for a Civil 3d Cogo Point?

    Thanks Big Al. That Worked!

    I always thought that lisp routines had to start with "c:", I guess it can be anything like AT: or AH:.

Similar Threads

  1. 2017: How to add a cogo point along a 3D polyline at a random point
    By tadthurston725387 in forum AutoCAD Civil 3D - General
    Replies: 3
    Last Post: 2018-01-11, 01:42 PM
  2. 2016: Set All Cogo Points in Drawing to One Point Style
    By barshnizza494659 in forum AutoCAD Civil 3D - General
    Replies: 11
    Last Post: 2016-04-12, 12:56 PM
  3. 2016: Civil 3D > Map Annotation Label from Cogo Point number field
    By Trevor Deleske in forum AutoCAD Civil 3D - General
    Replies: 3
    Last Post: 2016-02-05, 11:31 PM
  4. Civil 3D 2010 cogo points & blocks
    By tommcgtx in forum AutoLISP
    Replies: 1
    Last Post: 2010-05-06, 01:19 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •