Adding multiple labels (General, Spot elevation,...) by selecting objects

Adding multiple labels (General, Spot elevation,...) by selecting objects

cwr001
Collaborator Collaborator
3,644 Views
15 Replies
Message 1 of 16

Adding multiple labels (General, Spot elevation,...) by selecting objects

cwr001
Collaborator
Collaborator

Hello,

 

this one is not a deal breaker but it would be nice to have:

Certain labels (the most important ones for me are "General" and "Spot Elevation on Surface") require the user to click on the desired spot one by one for each label.

I was wondering if there's a way to add more than one label by selecting objects (idealy: points).

(I know about "AddSpotElevLabelsOnGrid" but I don't want a grid but only specific points)

 

The workflow I'm looking for would be:
AddNoteLabel or AddSurfaceSpotElevLabel --> Select objects (points)--> Multiple labels are created

 

I could go the label COGO-points route but COGO points unfortunately don't allow reference texts.

Is there a way or maybe existing code to achieve this?

 

Thanks and best regards!

0 Likes
Accepted solutions (1)
3,645 Views
15 Replies
Replies (15)
Message 2 of 16

rkmcswain
Mentor
Mentor
Accepted solution

If you have one surface, the following lisp should be close to what you want, except it's currently set up to work with POINT entities. If you have multiple surfaces, the prompting is a little different and will require some editing.

 

(defun c:foo ( / sset k m i )
  (setq sset (ssget '((0 . "POINT"))) i 0)
  (repeat (sslength sset)
    (setq k (ssname sset i))
    (setq m (cdr (assoc 10 (entget k))))
    (vl-cmdf "._ADDSURFACESPOTELEVLABEL" m "")
    (setq i (1+ i))
  )
  (princ)
)

spot5.gif
R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 3 of 16

TerryDotson
Mentor
Mentor

If you were to consider third party add-ons, DotSoft's C3DTools can add spot elevations on a selection set of objects.  For linear objects like polylines/featurelines you can specify the interval.  Even contains a special alignment option to specify station range/interval and multiple offsets (-10,0,10 etc).

0 Likes
Message 4 of 16

cwr001
Collaborator
Collaborator

Thanks a lot - this works exactly how I envisioned it!

 

What would be the way to go about if I wanted the lisp to work if multiple surfaces are present?

Can you point me in the right direction - would this pseudo code approach be viable here?

 

- Get a list of points objects

- For each point:

---> _AddSurfaceSpotElevLabel 

---> Press Enter twice (I don't really care about which surface is used, I can assign them later with select similar)

---> Paste point coordinate from my list            

 

Does it work like this or do I have to opress the whole dialog with some deeper API-stuff?

@TerryDotson: Thanks for pointing out that possibility - I'll have a look! 🙂

0 Likes
Message 5 of 16

knuwan
Enthusiast
Enthusiast

Hi!

 

Can you kindly tell me how to run this LSP? I loaded it using "Load application" under "Manage".but dont know how to make it work to select the objects as you shown on your video.

 

Thanks.

 

/Krish

0 Likes
Message 6 of 16

cwr001
Collaborator
Collaborator

Sure thing:

* Copy the whole code from the codeblock and past  it into an empty *.txt-document. Rename that document to something like "MultipleLablesByPointSelection.lsp" (Make sure that the ending *.txt is changed to *.lsp).

* Start Autocad and run the command "APPLOAD". Select the just created Lisp-File and choose "Load".

* You can run the lisp by typing "FOO".

Note: "Foo" and "Bar" are common placeholders for code creation. If you want a more substantial command to start the lisp, you can just rename "FOO" in the *.lsp-file to something of your choice.

 

0 Likes
Message 7 of 16

rkmcswain
Mentor
Mentor

@knuwan -- In its current form, you load the lisp code, then the type in command would be "FOO". You can rename that before loading the file if desired.

R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 8 of 16

knuwan
Enthusiast
Enthusiast

Yes the "FOO" command worked.but it doesnt detect my blocks.

0 Likes
Message 9 of 16

knuwan
Enthusiast
Enthusiast

here is my scrshot.Capture.PNG

0 Likes
Message 10 of 16

knuwan
Enthusiast
Enthusiast

I even tried placing circles etc.but nothing get selected.

0 Likes
Message 11 of 16

rkmcswain
Mentor
Mentor

@knuwan - correct, the lisp code is filtering out every entity type except "POINT"

R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 12 of 16

knuwan
Enthusiast
Enthusiast

can you come up with a update that can be used in my situation?

0 Likes
Message 13 of 16

knuwan
Enthusiast
Enthusiast

you know what, I extracted points from the surface and ran the LISP wow! 

0 Likes
Message 14 of 16

rkmcswain
Mentor
Mentor
@knuwan wrote:

can you come up with a update that can be used in my situation?

@knuwan - feel free to edit the code to your needs.

Change "POINT" to whatever entity type you want. Some entity types may not work as expected, so experiment around.

 

(0 . "POINT")
R.K. McSwain     | CADpanacea | on twitter
Message 15 of 16

knuwan
Enthusiast
Enthusiast

OK! Thank you very much for the trick! 

Message 16 of 16

tony1978
Collaborator
Collaborator

Our company has two surface labels apps that allows you to automatic spot label all selected intersecting feature lines or polylines with a drawing. This is great for spot grading large amounts of concreate slabs for gas stations or airports projects. The other app allows the user to select a feature line and label all the vertices. A good example is selecting the gutter or top of curb feature line for a commercial property. Checkout or help videos below and also our suite of apps on the Autodesk App Store.  In one 3 acre commercial project my grading plan had 247 spot labels. With our app I was able to select 4 gutter line feature lines and 240 labels appear. Yes are they are dynamic to the surface. So if the feature line or polyline moves you can click the update bottom and the surface updates.  This also worked good for subdivision spot grading swales and pads.  

 

CCLS Tools - YouTube Channel 

Autodesk App Store  2021-05-22_2-01-33.png

 Tony Carcamo


President/Owner


Civil CAD Learning Solutions


DFW BIM Infrastructure User Group


LinkedIn | Twitter | Instagram | DFWBIUG |User Group




0 Likes