Change point style

Change point style

darrenb39SL5
Participant Participant
2,063 Views
6 Replies
Message 1 of 7

Change point style

darrenb39SL5
Participant
Participant

I'm using the following to change the point label style but I would also like to change the point style at the same time. Can anyone help with this?

 

;Civil 3d change Point Label Style
;---------------------------------

(vl-load-com)
(defun c:PAV ( / Cpnt Algn Algn_Name)

(SETQ CadApp (VLAX-GET-ACAD-OBJECT));Get AutoCAD Object
(setq C3dApp (vla-getinterfaceobject CadApp "AeccXUiLand.AeccApplication.12.0"));2018 C3D
(setq C3Ddoc (vla-get-activedocument C3dApp));Get Active Document
(setq ptlblstyles (vlax-get C3Ddoc 'pointlabelstyles));Get Point Styles
(setq style1 (vlax-get-property ptlblstyles 'item "PT-PAV"));get the Point Style
(mapcar 'vlax-release-object (list C3Ddoc C3dApp CadApp));release objects


;Select Points
(setq Slcsct (ssget))

;Selection Length
(setq SlcLen (sslength Slcsct))

;Counter
(setq tn 0)

(repeat SlcLen
(setq tmpname (ssname Slcsct tn))
(setq Cpnt (vlax-ename->vla-object tmpname))
(vlax-put-property Cpnt 'LabelStyle style1 )
(setq tn ( + tn 1))
);repeat


);defun

0 Likes
2,064 Views
6 Replies
Replies (6)
Message 2 of 7

Sea-Haven
Mentor
Mentor

A couple of suggestions

 

(setq C3dApp (vla-getinterfaceobject CadApp "AeccXUiLand.AeccApplication.12.0"));2018 C3D have a look at VERCHECK.lsp

(if (not ah:vercheck)(Load "vercheck"))
(ah:vercheck)

 

(setq Slcsct (ssget))     (setq Slcsct (ssget (list (cons 0 "(0 . "AECC_COGO_POINT")"))))

 

StyleName v's labelstyle

 

Your friend dumpit.lsp

 

0 Likes
Message 3 of 7

darrenb39SL5
Participant
Participant

This is what I got. Not sure where to go from here. 

 

Select object: ; IAeccPoint: IAeccPoint Interface
; Property values:
; Application (RO) = #<VLA-OBJECT IAeccApplication 0000026f3c35b5d0>
; Convergence (RO) = Civil 3D API: This operation is not supported because the geodetic coordinate system has not been set.
; Description = "EC"
; DescriptionFormat = "$*"
; DisplayName (RO) = Civil 3D API: The parameter is incorrect.
; Document (RO) = #<VLA-OBJECT IAeccDocument 0000026f3c35b420>
; Easting = 3.17832e+06
; Elevation = 29.2891
; EntityTransparency = "ByLayer"
; FullDescription (RO) = "EC"
; GridEasting = Civil 3D API: This operation is not supported because the geodetic coordinate system has not been set.
; GridNorthing = Civil 3D API: This operation is not supported because the geodetic coordinate system has not been set.
; Handle (RO) = "A745"
; HasExtensionDictionary (RO) = 0
; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000026f55fdac88>
; LabelRotation = 0.0
; LabelStyle = #<VLA-OBJECT IAeccLabelStyle 0000026f6e024310>
; Latitude = Civil 3D API: This operation is not supported because the geodetic coordinate system has not been set.
; Layer = "V-CTRL-Grid_2"
; Linetype = "ByLayer"
; LinetypeScale = 1.0
; Lineweight = -1
; Location = (3.17832e+06 1.38193e+07 29.2891)
; Longitude = Civil 3D API: This operation is not supported because the geodetic coordinate system has not been set.
; Material = "ByLayer"
; Name = ""
; Northing = 1.38193e+07
; Number = 314
; ObjectID (RO) = 46
; ObjectName (RO) = "AeccDbCogoPoint"
; OwnerID (RO) = 43
; PlotStyleName = "ByLayer"
; ProjectVersion (RO) = Civil 3D API: The parameter is incorrect.
; RawDescription = "EC"
; Rotation = 0.0
; Scale (RO) = Civil 3D API: This operation is not supported because the geodetic coordinate system has not been set.
; ShowToolTip = -1
; Style = #<VLA-OBJECT IAeccPointStyle 0000026f64b03960>
; StyleName (RO) = "<none>"
; SurveyPoint (RO) = 0
; TrueColor = #<VLA
Select object:
-OBJECT IAcadAcCmColor 0000026f55fdae60>
; Visible = -1
; XYScale = 1.0
; ZScale = 1.0

0 Likes
Message 4 of 7

Sea-Haven
Mentor
Mentor

Having a quick look you need to change the actual point style so need to get "Points" and find the actual point then edit its property. Use say the point number.

0 Likes
Message 5 of 7

Sea-Haven
Mentor
Mentor

Try this be carefull about string case must match. eg Tr1 did not work but TR1 does.

 

(vl-load-com)
(if (not AH:vercheck)(load "vercheck"))
(ah:vercheck)

(defun c:psty ( / sty num ptnum ss x points)
(setq points (vlax-get-property *aeccDoc* "Points")) (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 points (setq num (vlax-get point 'Number)) (if (= num ptnum) (vlax-put-property Point 'Style sty) ) ) ) ) )
0 Likes
Message 6 of 7

darrenb39SL5
Participant
Participant

I guess I just don't know enough yet to make this work. I appreciate your help and I just need to read up on the subject a little more.

0 Likes
Message 7 of 7

Sea-Haven
Mentor
Mentor

It should be pretty obvious, say added some manual tree points xyz etc so style name wanted is TR, pick points a tree block appears.

0 Likes