Visual LISP, AutoLISP and General Customization

Reply
Member
Posts: 4
Registered: ‎04-30-2012
Message 1 of 11 (521 Views)

Label 3d solid (pipe)

521 Views, 10 Replies
04-30-2012 02:35 PM

Does anyone know how to create a label for existing 3d Solid (3d pipes made with sweep and extrude)? I want the label to pull the layer name, color, pipe length automatically.

I would just do it manually but I need to label piping in an entire plant. :smileysad:

 

Help

*Expert Elite*
Posts: 1,377
Registered: ‎08-16-2007
Message 2 of 11 (516 Views)

Re: Label 3d solid (pipe)

04-30-2012 04:21 PM in reply to: JudyR

(getpropertyvalue <ename> "height") would return the height of an extrusion of a selected object

(getpropertyvalue <ename> "length") would return the length of the path for a sweep

 

I really cannot believe you are using 3d solids to model pipes for an entire plant though.  AutoCAD MEP would seem to be a much better choice for drawing piping, plumbing and controls for a plant IMO.

 

 

The functions listed above are only applicable for 2012 and higher.  There is no autolisp access to these properties in earlier versions AFAIK with either entget access or via activeX. For those versions you should consider .NET or Object Arx.

Member
Posts: 4
Registered: ‎04-30-2012
Message 3 of 11 (513 Views)

Re: Label 3d solid (pipe)

04-30-2012 05:29 PM in reply to: dbroad

3d pipes were already drawn in basic AutoCAD for the entire plant. I need to label, so we can place real life labels on the phyical pipes. (and know how many, type, size to order)

 

The previous labels (what there were) have faded and need replaced.

 

Thank you for your help.

Mentor
Posts: 1,682
Registered: ‎03-14-2004
Message 4 of 11 (510 Views)

Re: Label 3d solid (pipe)

04-30-2012 05:49 PM in reply to: JudyR
try DATAEXTRACTION or DX .
Member
Posts: 4
Registered: ‎04-30-2012
Message 5 of 11 (507 Views)

Re: Label 3d solid (pipe)

04-30-2012 07:12 PM in reply to: devitg

I tried data extraction. It will give me a list of layer names and colors for 3d Solids. But I could not get lengths. I need lengths because we need to label every 50 feet. Also the engineer wants the pipes labeled to help the tech place the labels in the field.

 

I would just love it, if I could select the 3d solids and they would automatically label each pipe with the layer name, color and length (or just place the block label every 50 feet). Then I could extract the data from the blocks and the engineer could order the labels from that list. And I could generate a list for the tech of all the labels he would need in a given area. But I just don't know enough to write that program. :smileysad:

 

Mentor
Posts: 1,682
Registered: ‎03-14-2004
Message 6 of 11 (497 Views)

Re: Label 3d solid (pipe)

04-30-2012 08:57 PM in reply to: JudyR
Pease, upload a sample dwg
Member
Posts: 4
Registered: ‎04-30-2012
Message 7 of 11 (476 Views)

Re: Label 3d solid (pipe)

05-01-2012 06:36 AM in reply to: devitg

Attached is a sample of the piping I need to label. I have not officially started to label yet because I am still trying to find the best (easiest and quickest) way.

Mentor
Posts: 1,682
Registered: ‎03-14-2004
Message 8 of 11 (457 Views)

Re: Label 3d solid (pipe)

05-01-2012 11:57 AM in reply to: dbroad

When I use , at the DWG sample posted by OP

 

 

(setq 3d-solid (car (entsel)))
(setq 3d-solid-LENGTH(getpropertyvalue 3d-solid "length"))

 

 

I get this error

 

 

; error: ADS request error

 

 

 

 

 

What could it be?

*Expert Elite*
Posts: 1,377
Registered: ‎08-16-2007
Message 9 of 11 (453 Views)

Re: Label 3d solid (pipe)

05-01-2012 12:17 PM in reply to: JudyR

I know of no way to automatically label these solids in a fully automatic way by using lisp.

 

These are the problems:

1) At least some of what should be extrusions or sweeps are neither.  That means properties like length and height are not part of the objects.

2) A program might look at each solid's boundingbox (2 points that define the mininum xyz and maximum xyz.  Unless all objects being tracked had a principle axis in either the x, y, or z direction however, then assuming the long direction would be the length would lead to errors whenever the pipes were not parallel to the x, y, or z axes.

 

I suggest you create a dimension style without dimension or extension lines and with the prefix and suffix text you desire and dimension the pipe lengths to get correct reporting.  It shouldn't be too difficult to get the job done quickly by using dimensions.

 

Time to earn your pay.

 

To determine the available properties for object themselves, you can use (dumpallproperties (car(entsel)))

Distinguished Contributor
Posts: 110
Registered: ‎09-23-2008
Message 10 of 11 (431 Views)

Re: Label 3d solid (pipe)

05-02-2012 01:47 AM in reply to: JudyR

Every pipe seems to have an associated axis:  Could a routine use those curves instead of the 3DSolids?

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community