Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

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

Label 3d solid (pipe)

561 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*
dbroad
Posts: 1,551
Registered: ‎08-16-2007
Message 2 of 11 (556 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
JudyR
Posts: 4
Registered: ‎04-30-2012
Message 3 of 11 (553 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
devitg
Posts: 1,703
Registered: ‎03-14-2004
Message 4 of 11 (550 Views)

Re: Label 3d solid (pipe)

04-30-2012 05:49 PM in reply to: JudyR
try DATAEXTRACTION or DX .
Member
JudyR
Posts: 4
Registered: ‎04-30-2012
Message 5 of 11 (547 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
devitg
Posts: 1,703
Registered: ‎03-14-2004
Message 6 of 11 (537 Views)

Re: Label 3d solid (pipe)

04-30-2012 08:57 PM in reply to: JudyR
Pease, upload a sample dwg
Member
JudyR
Posts: 4
Registered: ‎04-30-2012
Message 7 of 11 (516 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
devitg
Posts: 1,703
Registered: ‎03-14-2004
Message 8 of 11 (497 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*
dbroad
Posts: 1,551
Registered: ‎08-16-2007
Message 9 of 11 (493 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
SEANT61
Posts: 125
Registered: ‎09-23-2008
Message 10 of 11 (471 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?

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.