Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

macros ??

1 REPLY 1
Reply
Message 1 of 2
jive
125 Views, 1 Reply

macros ??

Is there a macro OR routine to turn off label with a 'click of the button'??? such as activating an icon, select label and it's visible state goes to false........????? I am not verse with VBA..... I have discoverd many similiar shortcuts that could enhance effiency
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: jive


You can control label visibility with the click of
button if you Right Click on the drawing and select "Edit Label Style
Defaults..."  Expand the Label category and toggle the visibilty to
False.  That will turn off all the labels for the drawing.  You also
have the same control per feature.   Select the feature in the
settings manager, rt click and select "Edit Label Style Defaults..." - that
will turn off the labels for that specific feature.  You can then go back
up to the drawing node and turn all the labels back on again.  

 

You could also make a nice VBA app which would be a
toolbar that would let you just toggle the labels per feature.  This code
(for alignments) would get your started.

 


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Option
Explicit


style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">

style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Public g_oCivilApp As
AeccApplication



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Public g_oAeccDoc As
AeccDocument



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Public g_oAeccDb As
AeccDatabase



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">

 



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Function
getCivilObjects() As Boolean



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">    Dim
oApp As AcadApplication



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">    Set
oApp = ThisDrawing.Application



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">   
Const sAppName = "AeccXUiLand.AeccApplication.3.0"



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">    Set
g_oCivilApp = oApp.GetInterfaceObject(sAppName)



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">    If
g_oCivilApp Is Nothing Then



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">       
MsgBox "Error creating " & sAppName & ", exit."



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">       
getCivilObjects = False



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">       
Exit Function



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">    End
If



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">    Set
g_oAeccDoc = g_oCivilApp.ActiveDocument



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">    Set
g_oAeccDb = g_oAeccDoc.Database



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">   
getCivilObjects = True



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">End
Function



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">

 



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">

 



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Public Sub
ToggleAlignmentLabels()



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">   
getCivilObjects



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">   
g_oAeccDb.Settings.AlignmentSettings.LabelStyleDefaults.LabelProperties.Visibility
= Not
g_oAeccDb.Settings.AlignmentSettings.LabelStyleDefaults.LabelProperties.Visibility



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">End
Sub



style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">

 


Dan

 

Is there a macro OR routine to
turn off label with a 'click of the button'???   such as activating an
icon, select label and it's visible state goes to false........????? I am not
verse with VBA..... I have discoverd many similiar shortcuts that could enhance
effiency

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report