Need a Lisp to populate callout for Polyline attributes

Need a Lisp to populate callout for Polyline attributes

Anonymous
Not applicable
1,433 Views
8 Replies
Message 1 of 9

Need a Lisp to populate callout for Polyline attributes

Anonymous
Not applicable

Hi All,

 

Can some help me out with a LISP that populates an automated callout for polylines attributes?

Callout should populate Material and Diameter.

 

Thanks,

Shreeram

0 Likes
1,434 Views
8 Replies
Replies (8)
Message 2 of 9

Moshe-A
Mentor
Mentor

@Anonymous  hi,

 

have you gave up all the info we need to understand what you want or there is more?

 

 

 

 

 

0 Likes
Message 3 of 9

Anonymous
Not applicable

Utility Polylines in DWG has OD information. We need to populate only Diameter and Material from that as a callout. as shown in Screenshot.  Looking for automated lisp to generate. Kindly let me know if you need any additional information. Looking forward

0 Likes
Message 4 of 9

maratovich
Advisor
Advisor

The polyline has no attributes.
Unable to get information from polyline.
You need to create a block with a polyline, then add attributes. After that it will be possible to get information.

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 5 of 9

Anonymous
Not applicable

Please see the Screenshot

0 Likes
Message 6 of 9

maratovich
Advisor
Advisor

In the standard AutoCAD there is no such.
What supplements do you use?

147.png

---------------------------------------------------------------------
Software development
Automatic creation layouts and viewport. Batch printing drawings from model.
www.kdmsoft.net
0 Likes
Message 7 of 9

cwofford
Participant
Participant

I am also wanting to know if anyone could write a lisp or maybe make an add-in that could take any information within any type of polyline and create a multileader with text stating the attribute or properties selected from properties pallet of that polyline.

 

attached is a image of my screen that shows OD:FIBERCABLE_BURIED and almost everthing that gets sent to us has this kind of information. I'v been attempting to hunt down a lisp routine, add-ins, and even apps for a couple years now and still no luck.

 

im also attaching a DWG so you can play with it and try to figur it out.

 

If someone from the city or where ever can input the information into the properties pallett within a polyline, then we should be able to retreive said info and turn it into text with no problems. It is just all code within the program....Right?? 

 

 

0 Likes
Message 8 of 9

Sea-Haven
Mentor
Mentor

You have what is known as Object Data this is from a GIS system etc and yes you can get at it pretty easy. You can see the Field names so that helps. Will see if I can do something. Its not the 1st post https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/looking-for-examples-and-documentati...

0 Likes
Message 9 of 9

Sea-Haven
Mentor
Mentor

Here is an example of getting object data.

; simple object data example
; By Alan H July 2019

(defun c:odtest ( / ent ty odname dia material)
(setq ent (car (entsel "\n Select Polyline (or press Enter to Exit): ")))
(setq ty (cdr (assoc 0 (entget ent))))
	(if (and (eq "LWPOLYLINE" ty)
	  (/= (setq odname (ade_odgettables ent)) nil)
	   )
	 (progn
           (setq dia (ade_odgetfield ent odname "Diameter" 0))
           (setq mat (ade_odgetfield ent odname "Material" 0))
           (alert (strcat "Material: " mat " \nDiameter " (rtos dia 2 2) (chr 34) " Main"))
           )
         )
(princ)
)
(c:odtest)

 

 

0 Likes