Macro to change all point groups in drawing pointstyle and pointlabelstyle to none

Macro to change all point groups in drawing pointstyle and pointlabelstyle to none

RickfromtheNorth
Advocate Advocate
1,502 Views
11 Replies
Message 1 of 12

Macro to change all point groups in drawing pointstyle and pointlabelstyle to none

RickfromtheNorth
Advocate
Advocate

Hi trying to write a macro to change all point groups pointstyle and pointlabelstyle to none in my current drawing.

Here is what I have so far.

 

^c^c(if(setq ss(ssget "x" (list(cons 0 'PointGroups)))) (PROGN (REPEAT (SETQ I (SSLENGTH SS)) (SETQ OBJ (VLAX-ENAME->vla-object (ssname ss (setq i (1- i)))))(vlax-put-styl obj 'PointStyles "<none>"))))

 

Any ideas?

 

 

0 Likes
1,503 Views
11 Replies
Replies (11)
Message 2 of 12

Jeff_M
Consultant
Consultant

Pointgroups are not selectable entities so you need to get the PointGroups collection from the C3D activedocument. Regardless of that fact, I have never found a way using lisp to set the pointstyle or pointlabelstyle to none or nil. 

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 12

RickfromtheNorth
Advocate
Advocate

Well that's not good news, My goal was to be able to turn on and off just my points in drawing without dealing with point groups sending no display to the top and all that or putting points on a layer then turning that on and off. You mentioned accessing pointgroups through active document. If I wanted to change all my pointgroups, pointlabelstyle and pointstyle to something other than <none> is that possible?

Thanks Jeff for the Reply 

0 Likes
Message 4 of 12

Jeff_M
Consultant
Consultant

@RickfromtheNorth How would you deal with turning the point display back on? Once you change all PointGroups to have a no display style you would need a way to set them back to how they were. This would be very inefficient I would think. You would be better off, IMHO, to create a NoDisplay PG and have a toggle to move it to the top or bottom of the display order. This is something that can be done in .NET but the DisplayOrder is not available in COM.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 5 of 12

RickfromtheNorth
Advocate
Advocate

Your right it's not ideal I would have to toggle it back after again. I have a .net to move all points to the top but nothing for moving no display to the top. Is there a post with .net program that would do this on the forums here? 

0 Likes
Message 6 of 12

Jeff_M
Consultant
Consultant

@RickfromtheNorth I'm guessing you got the .NET tool to move the _AllPoints group to the top HERE. Further down in that thread I added a new tool which includes moving the "No_Display" group to the top.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 7 of 12

RickfromtheNorth
Advocate
Advocate

Yes I see that, thx, Now I just need to add in movenodisplaytobottom to this somehow. I have visual studio now perhaps I can edit the code using that?

Thanks

0 Likes
Message 8 of 12

Jeff_M
Consultant
Consultant

Yes, you should give it a try! Attached is the c# project to get you started.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 9 of 12

RickfromtheNorth
Advocate
Advocate

Thanks for the head start Jeff, is their a way to compile the code in Visual studio into a DLL? I can't seem to find anything handy from google.

Thanks

0 Likes
Message 10 of 12

Jeff_M
Consultant
Consultant

When you Build the Solution it will create the dll in the folder specified in the Project properties.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 11 of 12

essam-salah
Advisor
Advisor

hi @RickfromtheNorth 

you don't need any lisp to set all cogo points/label styles  to none, just set _All Point points/label styles to none then move it to the top of all points groups.

0 Likes
Message 12 of 12

RickfromtheNorth
Advocate
Advocate

Hi, Yes I realize their are many work arounds but I want a one step process. I'm lazy like that. hahaha

0 Likes