Jump to content

Electrical device


dhl

Recommended Posts

Hi guys,

 

I'm still a newbie at lisp and VBA, but I'm trying to create a lisp routine that extracts the style name from an electrical device in MEP 2009.

 

For instance if the style is called "circuit breaker" I want to be able to extract this string and use it later on in a text command.

 

The problem is I don't know how to extract this info. I've been searching for dxf codes to use through the "assoc" function, but haven't found anything so far.

 

Does anyone know how this is done or where I can find a dxf reference guide for electrical mep devices?

 

cheers!

Link to comment
Share on other sites

Hi guys,

 

I'm still a newbie at lisp and VBA, but I'm trying to create a lisp routine that extracts the style name from an electrical device in MEP 2009.

 

For instance if the style is called "circuit breaker" I want to be able to extract this string and use it later on in a text command.

 

The problem is I don't know how to extract this info. I've been searching for dxf codes to use through the "assoc" function, but haven't found anything so far.

 

Does anyone know how this is done or where I can find a dxf reference guide for electrical mep devices?

 

cheers!

 

Hi dhl,

 

Welcome to the forum, If the item is an acad block or any type of acad entity this program will return the dxf data assocated with your selection. I do not use MEP 2009, But I will assume they are still acad entities.

 

Give it a shot.

 

 

(defun C:pdxf (/ pick)
 (if (setq pick (car (entsel "\nSelect Object: ")))
   (progn (textscr)
   (foreach x (entget pick)
     (print x))))
 (princ))

Link to comment
Share on other sites

Thanks buzzard this was exactly the kind of lisp routine I was looking for /trying to create myself! Thanks a lot

 

However, is seems as Autocad Mep store device info somewhere than inside of the entity, and I unfortunately dont have a clue about how. I'll insert the dxf return from your program and perhaps it makes sense to someone about where I can find the style name and so on.

 

Command: pdxf
Select Object:
(-1 . <Entity name: 7ffff946b10>)
(0 . "AECB_DEVICE")
(330 . <Entity name: 7ffff9039f0>)
(5 . "1B0C1")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "E-63F-3IE-N")
(100 . "AecDbEntity")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbImpDevice")
(100 . "AecImpObj")
(3 . "")
(100 . "AecImpEnt")
(171 . 0)
(100 . "AecImpGeo")
(10 28226.0 39324.0 0.0)
(15 1.0 0.0 0.0)
(16 0.0 1.0 0.0)
(210 0.0 0.0 1.0)
(360 . <Entity name: 0>)
(100 . "AecImpLayoutTool")
(100 . "AecbImpBuildingServiceMember")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogData")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogData")
(102 . "{AECB_PART_DATA_FIELD_ARRAY")
(100 . "AecImpObj")
(3 . "")
(100 . "AecImpArray")
(90 . 10)
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_Circuit")
(1 . "Circuit")
(63 . 684)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 5)
(341 . <Entity name: 0>)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_Load")
(1 . "Load Phase 1")
(1 . "0.000000")
(63 . 682)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "Phase2_Load")
(1 . "Load Phase 2")
(1 . "0.000000")
(63 . 1319)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "Phase3_Load")
(1 . "Load Phase 3")
(1 . "0.000000")
(63 . 1320)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_Voltage")
(1 . "Voltage")
(1 . "-2.000000")
(63 . 681)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . -2.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_NoOfPoles")
(1 . "Number of Poles")
(1 . "-2")
(63 . 680)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 2)
(91 . -2)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_DemandFactor")
(1 . "Load Category")
(63 . 683)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 5)
(341 . <Entity name: 0>)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "Sub_Load_Category1")
(1 . "Load Sub-category")
(63 . 1327)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 5)
(341 . <Entity name: 0>)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_Overcurrent")
(1 . "Maximum Overcurrent Rating (amps)")
(1 . "0.000000")
(63 . 697)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_PowerFactor")
(1 . "Power Factor")
(1 . "0.000000")
(63 . 698)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "AECB_PART_DATA_FIELD_ARRAY}")
(102 . "AEC_SUBOBJECT}")
(102 . "{AECB_CONNECTION_COMPONENTS")
(100 . "AecImpObj")
(3 . "")
(100 . "AecImpArray")
(90 . 1)
(102 . "{AEC_SUBOBJECT")
(300 . "AecbConnectionComponentMember")
(100 . "AecImpObj")
(3 . "")
(100 . "AecConnectionComponent")
(100 . "AecbConnectionComponentMember")
(342 . <Entity name: 7ffff90d6f0>)
(341 . <Entity name: 0>)
(10 1.0 0.0 0.0)
(90 . 1)
(91 . 1)
(92 . 3)
(93 . 0)
(94 . 0)
(95 . 0)
(63 . 0)
(96 . 102)
(102 . "AEC_SUBOBJECT}")
(102 . "AECB_CONNECTION_COMPONENTS}")
(341 . <Entity name: 7ffff9469b0>)
(100 . "AecbImpMvPartBase")
(102 . "{AECB_MVPARTBASE_ANNOTATION_BLOCK")
(100 . "AecImpObj")
(3 . "")
(100 . "AecImpArray")
(90 . 0)
(102 . "AECB_MVPARTBASE_ANNOTATION_BLOCK}")
(63 . 0)
(343 . <Entity name: 0>)
(344 . <Entity name: 0>)
(90 . 0)
(91 . 0)
(15 1.0 1.0 1.0)
(92 . 6)
(64 . 0)
(11 0.0 0.0 0.0)
(12 0.0 0.0 0.0)
(13 0.0 0.0 0.0)
(14 0.0 0.0 0.0)
(100 . "AecbImpDevice")
(40 . 0.0)
(9 . "")
(341 . <Entity name: 7ffff90d3e0>)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_NULLOBJECT}")
(100 . "AecDbGeo")
(100 . "AecDbLayoutTool")
(100 . "AecbDbBuildingServiceMember")
(100 . "AecbDbMvPartBase")
(100 . "AecbDbDevice")

Link to comment
Share on other sites

Thanks buzzard this was exactly the kind of lisp routine I was looking for /trying to create myself! Thanks a lot

 

However, is seems as Autocad Mep store device info somewhere than inside of the entity, and I unfortunately dont have a clue about how. I'll insert the dxf return from your program and perhaps it makes sense to someone about where I can find the style name and so on.

 

Command: pdxf
Select Object:
(-1 . <Entity name: 7ffff946b10>)
(0 . "AECB_DEVICE")
(330 . <Entity name: 7ffff9039f0>)
(5 . "1B0C1")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "E-63F-3IE-N")
(100 . "AecDbEntity")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbImpDevice")
(100 . "AecImpObj")
(3 . "")
(100 . "AecImpEnt")
(171 . 0)
(100 . "AecImpGeo")
(10 28226.0 39324.0 0.0)
(15 1.0 0.0 0.0)
(16 0.0 1.0 0.0)
(210 0.0 0.0 1.0)
(360 . <Entity name: 0>)
(100 . "AecImpLayoutTool")
(100 . "AecbImpBuildingServiceMember")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogData")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogData")
(102 . "{AECB_PART_DATA_FIELD_ARRAY")
(100 . "AecImpObj")
(3 . "")
(100 . "AecImpArray")
(90 . 10)
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_Circuit")
(1 . "Circuit")
(63 . 684)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 5)
(341 . <Entity name: 0>)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_Load")
(1 . "Load Phase 1")
(1 . "0.000000")
(63 . 682)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "Phase2_Load")
(1 . "Load Phase 2")
(1 . "0.000000")
(63 . 1319)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "Phase3_Load")
(1 . "Load Phase 3")
(1 . "0.000000")
(63 . 1320)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_Voltage")
(1 . "Voltage")
(1 . "-2.000000")
(63 . 681)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . -2.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_NoOfPoles")
(1 . "Number of Poles")
(1 . "-2")
(63 . 680)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 2)
(91 . -2)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_DemandFactor")
(1 . "Load Category")
(63 . 683)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 5)
(341 . <Entity name: 0>)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "Sub_Load_Category1")
(1 . "Load Sub-category")
(63 . 1327)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 5)
(341 . <Entity name: 0>)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_Overcurrent")
(1 . "Maximum Overcurrent Rating (amps)")
(1 . "0.000000")
(63 . 697)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_SUBOBJECT")
(300 . "AecbPartCatalogDataField")
(100 . "AecImpObj")
(3 . "")
(100 . "AecbPartCatalogDataField")
(1 . "ConnectionProp_PowerFactor")
(1 . "Power Factor")
(1 . "0.000000")
(63 . 698)
(90 . 1)
(66 . 0)
(68 . -1)
(65 . 1)
(40 . 0.0)
(281 . 0)
(282 . 0)
(283 . 1)
(102 . "AEC_SUBOBJECT}")
(102 . "AECB_PART_DATA_FIELD_ARRAY}")
(102 . "AEC_SUBOBJECT}")
(102 . "{AECB_CONNECTION_COMPONENTS")
(100 . "AecImpObj")
(3 . "")
(100 . "AecImpArray")
(90 . 1)
(102 . "{AEC_SUBOBJECT")
(300 . "AecbConnectionComponentMember")
(100 . "AecImpObj")
(3 . "")
(100 . "AecConnectionComponent")
(100 . "AecbConnectionComponentMember")
(342 . <Entity name: 7ffff90d6f0>)
(341 . <Entity name: 0>)
(10 1.0 0.0 0.0)
(90 . 1)
(91 . 1)
(92 . 3)
(93 . 0)
(94 . 0)
(95 . 0)
(63 . 0)
(96 . 102)
(102 . "AEC_SUBOBJECT}")
(102 . "AECB_CONNECTION_COMPONENTS}")
(341 . <Entity name: 7ffff9469b0>)
(100 . "AecbImpMvPartBase")
(102 . "{AECB_MVPARTBASE_ANNOTATION_BLOCK")
(100 . "AecImpObj")
(3 . "")
(100 . "AecImpArray")
(90 . 0)
(102 . "AECB_MVPARTBASE_ANNOTATION_BLOCK}")
(63 . 0)
(343 . <Entity name: 0>)
(344 . <Entity name: 0>)
(90 . 0)
(91 . 0)
(15 1.0 1.0 1.0)
(92 . 6)
(64 . 0)
(11 0.0 0.0 0.0)
(12 0.0 0.0 0.0)
(13 0.0 0.0 0.0)
(14 0.0 0.0 0.0)
(100 . "AecbImpDevice")
(40 . 0.0)
(9 . "")
(341 . <Entity name: 7ffff90d3e0>)
(102 . "AEC_SUBOBJECT}")
(102 . "{AEC_NULLOBJECT}")
(100 . "AecDbGeo")
(100 . "AecDbLayoutTool")
(100 . "AecbDbBuildingServiceMember")
(100 . "AecbDbMvPartBase")
(100 . "AecbDbDevice")

 

 

To get to a specific entity within a block, I would explode the block and run the routine again, But only selecting the entity in question.

 

Give that a try and see what happens.

Again, I am not sure about MEP 2009 entities.

I can see a dxf list was returned all the same.

If this is hidden information like an attribute I would try to explode the object

and see what shows up. I am not sure where this info you are looking for

is stored.

 

 

If you have not gone to the following forum for advise I would try here at the MEP forum and ask your question. You may find what you need here.

 

http://www.cadtutor.net/forum/forumdisplay.php?f=61

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...