Error: Automation Error. The drawing is in color dependent plot style mode

Error: Automation Error. The drawing is in color dependent plot style mode

dlbsurveysuk
Collaborator Collaborator
395 Views
3 Replies
Message 1 of 4

Error: Automation Error. The drawing is in color dependent plot style mode

dlbsurveysuk
Collaborator
Collaborator

Everything in my drawing is set to Color ByLayer.

 

A pointcloud with Stylization set to Object Color is white.

 

If I select the pointcloud and change to Color ByBlock in the properties panel, the pointcloud is now black.

 

Now using this Lisp routine to toggle between ByLayer and Byblock gives me an error.

I don't know how to resolve this.

 

Thanks.

 

(defun c:KK (/ SS COUNT PCLOUD LAYOBJ)

(setvar 'cmdecho 0)
(vl-load-com)

     (setq SS (ssget "A" '((8 . "A-point-clouds"))))
      (setq COUNT 0)

   (repeat (sslength SS)
       (setq PCLOUD (ssname SS COUNT) COUNT (+ 1 COUNT))

              (setq LAYBLK (vla-get-PlotStyleName (setq ENT (vlax-ename->vla-object PCLOUD))))

              (if (= LAYBLK "ByLayer")
                      (vla-put-plotstyleName ENT "ByBlock")
                      (vla-put-plotstyleName ENT "ByLayer")
              )
    )

(princ)
)

 

Error: Automation Error. The drawing is in color dependent plot style mode
0 Likes
396 Views
3 Replies
Replies (3)
Message 2 of 4

paullimapa
Mentor
Mentor

You can only change an object's (not just POINT CLOUDS's) Plot Style when you're NOT using Color Dependent but Named  Plot Styles.  This is why in the Properties Palette the Plot Style selection is disabled.

So if you were to run ConvertPstyles command & choose a stb file that has a color mapping table then your drawing will now be using Named Plot Styles

Now you can use vla-put-plotstyleName function to place a Named Plot Style onto any object like POINT CLOUDS.

Also the Properties Palette will now have Plot Style selection enabled.

To see what are the available Named Plot Styles use this function:

(dictsearch (namedobjdict) "ACAD_PlotStyleName")

Each of the assoc 3 pairs contains a Named Plot Styles.

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 4

dlbsurveysuk
Collaborator
Collaborator

OK thanks. I'll have to look into that.

0 Likes
Message 4 of 4

paullimapa
Mentor
Mentor

You’re welcome…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes