Need a Lisp to populate callout for Polyline attributes

Need a Lisp to populate callout for Polyline attributes

Anonymous
適用対象外
1,481件の閲覧回数
8件の返信
メッセージ1/9

Need a Lisp to populate callout for Polyline attributes

Anonymous
適用対象外

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 件のいいね
1,482件の閲覧回数
8件の返信
返信 (8)
メッセージ2/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 件のいいね
メッセージ3/9

Anonymous
適用対象外

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 件のいいね
メッセージ4/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 件のいいね
メッセージ5/9

Anonymous
適用対象外

Please see the Screenshot

0 件のいいね
メッセージ6/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 件のいいね
メッセージ7/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 件のいいね
メッセージ8/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 件のいいね
メッセージ9/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 件のいいね