AutoCAD Civil 3D :: Modify Point Label Style Using Visual Lisp
Feb 19, 2013
I am having trouble drilling down to the object that contains the point label components. Specifically, I would like to access values such as Anchor Component, Anchor Point, Text Height, X Offest, and Y Offset for the various components of the Point Label Style. I am able to get the Point Label Style by name (object dump below) but I don't know how to get at the components that I want to work with.
I am trying to use autolisp to change the point label style in autolisp. Mostly teach you how to do it manually, I not sure there is a way to do it in autolisp.
I'm using AutotCAD Civil 3D 2012 in the Civil 3D workspace, trying to create a point label style to show what I need it to show. I click on a point and select it's properties. Once on the properties tab I go down to the point label style box and clicked on the down arrow. A list of options then comes up and I selected the create/edit option. A small point label style box then appears and i choose the button directly next to the drop-down list and the label style composer box pops up. In this box I go to the layout tab and then go down to the contents box. I select the browse button next to the contents to select the contents. I select the contents I want but when I apply it every point has those contents and I need just that one point to have those contents.
Imported points and I have a label style to label tree sizes automatically, but when there are many trees near each other labels start to overlap. So I will typically rotate the label style 180 degree or drag the label, but I am curious if its possible to have label always stay horizontal no matter what my rotation angle is.
Civil3D 2013 Windows 7, 64 bit Intel i7 2600 @ 3.40Ghz 16 GB RAM Nvidia Quadro 600
i have a building corner point label style that labels the corner of bldgs with the elev on top of an arrow and the full description of a bdlgc on bottom of arrow...rotated at 45 degrees....
i have 3 components...a block of an autocad leader i call an arrow that i just drew from left to rt on layer 0 and named the component arrow...then i have the elevation and the description
problem is that when i rotate label to move it out of way of obstructions it flips the elev on bottom and the desc on top!!
i have tried a number of combinations of anchor pts and changing the "flip anchor pts with text" to true/false under the general tab of the label style composer...
Point label styles do not scale properly in raster plots. Raster plots have long been my fix for making wipeouts and masks behave. Without the excellent fix raster plots have been, I'm sunk! All of my work depends upon raster plotting to maintain consistently correct output with absolutely no wipeout or masking errors. My point label styles all have a text height of 0.11" which is the plotted height according to the documentation. They are exactly the right height in all page setups with non-raster plot devices. But, when my page setup includes a raster device the text is scaled to just a speck. It should be 32 pixels high at the 288 pixels per inch I have specified but it is barely two or three pixels high both on my display and in my ploits.
The attachments show the wipeout/mask problem in 2012 DWF output and the rescaling of point labels in 2012 raster (TIFF) output. I am in critical need of a fix that does not involve special point label styles just for raster plots. Autodesk!? I already have to use a special pen tables for raster plots with pens sizes scaled for each dpi resolution I use but that has been settled for many years now.
I did some search and got some code from 2009 post which not really working for me. Since I am not a pofr for autocad civil3D and just staring to learn how programing with autolisp, I am having trouble to debug the code:
(defun xp()(setq sset1 (ssget "X" '((0 . "AECC_PARCEL_SEGMENT")))) (COMMAND "EXPLODE" SSET1 "") if (= (setq ss (ssget "X" '((0 . "AECC_COGO_POINT")))) nil) (setq ss (ssget "x" '((0 . "AECC_COGO_POINT")))) ); FILTERS UNCLOSED POLYLINES(defun c:changestyle() (setq xlabel (vlax-ename->vla-object (car (entsel))))
I have set the default style for the drawing to a certain style by going to toolspace - settings and right clicking on point and clicking on edit feature settings ...under default styles i set it to the one I want for both point style and point label style......how come when I create a few manual points and then go to the prospector tab and right click on _all points, the point label style is not set to the default one I set it to as I described above? The points are not coming in the way I want them to?
I'm a bit new to the concepts of point labels in C3D; I browsed around for a bit for a solution and haven't been successful. I'm having troubles with my point label styles in Paperspace - they appear about 25x smaller than in model space, but both are the same scale.
This is my label style setup:
This is how it appears in modelspace:
This is my viewport settings and how it appears in paperspace (zoomed in):
The text height in MS is 2mm, and approx 0.078mm in PS.
Is there a way to set up a custom Point Label Style that will change the text color if the information entered meets particular criteria? I will be entering sample measurements taken on two (2) different dates, but if the sample data is greater than 1.0, I want it to show up a different color.
I would like to change the look of the point that I draw ni autocad.
When i draw a point (1 on the joined picture), I can choose different style (point, circle, square, ...) and increase or reduce the size (2 on the joined picture)
point.PNG
but the model stay allways thin, i would like to modify my point to look like the 3 ont the joined picture.
I know that 20 models are allready a lot of choice, but is there a possibility to modify the library of the point?
C3D 2013. We have profile line labels, some of which get manually edited (for example, change the "<[Tangent grade(FP|P2|RN|AP|GC|UN|SD|OF)]>" to a static number such as 0.29%).
However, if you CTRL+Click and select one of these labels and change the style of that one label, then the manual edits are lost and the label reverts back to the default string.
I am trying to change the default label styles for AddSegmentLabel under general styles using .NET...
Dim X As Autodesk.Civil.Settings.SettingsCmdAddSegmentLabel = CD.Settings.GetSettings(Of Autodesk.Civil.Settings.SettingsCmdAddSegmentLabel)()
X.Styles.LineLabel.Value = strChildStyleName ... says name does not exist
or
X.Styles.LineLabelStyleId.Value = oidChildStyle ... "The type of objectId is wrong"
If I manually change it to a child style and then check the values, they are the same as what I'm trying to set them to. If you use a "parent" style then these both work. Am I doing something wrong or this another limitation?
Civil 3D 2013 - Windows 7 Pro 64 - Dell T3500 - Xeon 2.67 - 24gb - Quadro 600
The label associated to a grading point when is moved when is moved changes its size automatically and a leader appears. After this happen no control over the grading point and its associate label. refer to the image below.
I am looking for a way to change the text style used by a table style with Visual LISP. So far I have been able to get the IAcadTableStyle object from the acad_tablestyle dictionary, but there is no property for text style. Is this even possible? Code and results are below.
Is there a way to programatically set a visual style before a drawing actually opens?
We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings. Some models will crash on some workstations when trying to open in a rendered mode.
I found a lisp with a function that looked to set viewport visual styles. But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)
Modify the attached lisp I found in this forum to work using a different hatch pattern, scale and angle. The new hatch should be in default Autocad "LINE" pattern and angle set to 90 degrees (vertical). If possible, I would like the angle and scale to be editable. Find attached Multi_Hatch-45 code posted by CADaStroumph in 2008.
I have a simple block with 2 attribute and 1 line inside it.
something like this:
Attribute1
──────
Attribute2
I want to modify length of line due to width of thoes attributs. length of line is equal to maximum(width attribute1 and width attribute2).
dxf code for start point of a line is 10 and end point for a line entity is 11.The question is: how can I modify the length of line automatically via maximum width of these attributes?
Any lisp routine on how to change "Drawing Properties" (fields via Mtext) on multiple single drawing files?
There are several instances where we would need to take a project to create another one and simply change the title block description.
As of now, we are opening each drawing (there could be hundreds) and modifiying the drawing properties on each drawing to change the customer name and other project descriptions.
These are not attributes, but fields. I've researched alot on here and couldnt find anything.
I have known co-ordinates that I want each grip for the table to be set at. I can't just copy and paste the table from drawing to drawing. Each table of each drawing have different textual values, and the column widths will best be sized for each text value.
Then I copy that selection set multiple times in a loop. What I would like to do is then rotate (or otherwise modify) the last copied group of items. If I rotate "last" it will only accept the last drawn item, so only one item in the group of copied objects will rotate.
Here is the portion of simple code I am using right now (it's in a loop so all variables with 'Next' are changing each time):
I need a lisp routine that will add or subtract to modify a value in a text string. Its used for drainage fixture units on waste & vent plans. Example: We use basic dtext strings that look like this [color=red]4"(6)[/color]I would like to be able to add or subtract to the number that is [b][size=12pt]ONLY[/size][/b] in parenthesis and would like to be able to pick multiple text strings at one time so it would result in something like this: [color=green]4"(6)[/color] + 9 will become [color=blue]4"(15)[/color].
How to set a default point style for point groups? Whenever I import survey points, I always put them into their own point group, so I can display each day's worth of survey data differently. For some reason, the point style always defaults to a certain style (our control point symbol). I'd like it to default to Basic, so I don't have to change this every time. Is it a template drawing setting somewhere?
How to change the dim text color in current dimstyle with a lisp routine? I want to modify current dimstyle instead of override current dimstyle, so it can change all existing dim text color under the current dimstyle.
I am starting with a polyline then i use the pasteblock command to insert that polyline as a block.Now i can pull up the property box and change the xyz scale.
I would like to know how to change these setting in my lisp.The scale will be x=1 y=0.1 z=1