Author Topic: Modifing insertion point for Revit DWG block output  (Read 2544 times)

0 Members and 1 Guest are viewing this topic.

lamarn

  • Swamp Rat
  • Posts: 636
Modifing insertion point for Revit DWG block output
« on: June 30, 2015, 05:36:40 PM »
Hi

I have quite some trouble working with DWG coming from Revit. Especially how families are being translated into blocks.
Many probably probably would say: don't use DWG output in the first place, ..ok.. I know.. but sometimes it is necessary anyway
Revit make unique blocknames for every instance but at the otherhand... and insertion points is the same!!
That is quite the world upside down for a AutoCAD block user.

So I have a little challenge to modify these definitions.
On this that helps is the recent 'ssb' select similar blocks routine from Lee MAC.
BUT.. I you would use that on Revit output all the blocks will be layed upon each other.

I was thinking maybe the CBIR change block insertion routine could be rewritten to parse multiple blocks
whereas for the insertion point the center of the geometry will be used.

Anyone you understands this story and have any idea (for other workarounds), I would appriate it.
Thanks
Hans

**
ATTACHED: THE VARIANT OF LEE MAC ROUTINE THAT CAN BE FOUND AT http://lee-mac.com/changeblockinsertion.html
PLEASE READ THE COMMENTS TO GET THIS ANY FURTHER. THANKS
**



« Last Edit: July 05, 2015, 04:06:08 PM by lamarn »
Design is something you should do with both hands. My 2d hand , my 3d hand ..

Rod

  • Newt
  • Posts: 185
Re: Modifing insertion point for Revit DWG block output
« Reply #1 on: June 30, 2015, 07:13:23 PM »
Hans,
If I understand you correctly that seems doable.
You could use the similarity of the block names to aid in selecting the blocks or inspect the extended data of the objects themselves. See (entget(car(entsel))'("REVIT")).
You will need to test this extended data further to see how it helps.
Rod
"All models are wrong, some models are useful" - George Box

NICK_VNV

  • Newt
  • Posts: 63
Re: Modifing insertion point for Revit DWG block output
« Reply #2 on: July 01, 2015, 02:05:49 AM »
..I was thinking maybe the CBIR change block insertion routine could be rewritten to parse multiple blocks
whereas for the insertion point the center of the geometry will be used.

Anyone you understands this story and have any idea (for other workarounds), I would appriate it.
Thanks
Hans
Do you mean Lee's CBBR command? It uses "LM:changeblockbasepoint" function so look there, it can be easily modified for change insertion point for each block in selection to the center of it's bounding box.
« Last Edit: July 01, 2015, 02:12:28 AM by NICK_VNV »
Sorry for my English...

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Modifing insertion point for Revit DWG block output
« Reply #3 on: July 01, 2015, 04:21:34 AM »
Certainly possible - I'll take a look when I get some time.

lamarn

  • Swamp Rat
  • Posts: 636
Re: Modifing insertion point for Revit DWG block output
« Reply #4 on: July 01, 2015, 07:55:04 AM »
That's the one! :)
But my lisp tricks are as bad as my written English so I could use some little help along the way :)
cheers
Design is something you should do with both hands. My 2d hand , my 3d hand ..

lamarn

  • Swamp Rat
  • Posts: 636
Re: Modifing insertion point for Revit DWG block output
« Reply #5 on: July 02, 2015, 05:00:57 PM »
I am thinking about how this routine can be converted to the following

http://lee-mac.com/lisp/html/ChangeBlockBasePointV1-5.html

Especially, this line of text:

Code: [Select]
(if (and (= 'ename (type ent)) (setq nbp (getpoint "\nSpecify New Base Point: ")))

- modus : the bounding box of the geometry can be used to modify insbase of the block. How to achieve it?

How can a point (e.g. left, under) be acquired from a bounding box? like in line
Code: [Select]
(vla-getBoundingBox (vlax-ename->vla-object e) 'll 'ur)
source: http://www.cadtutor.net/forum/showthread.php?54046-Bounding-Box-LISP


(- next thing then would be to get it to work on multiple picked blocks ..)

Thanks in regard
« Last Edit: July 02, 2015, 05:10:53 PM by lamarn »
Design is something you should do with both hands. My 2d hand , my 3d hand ..

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Modifing insertion point for Revit DWG block output
« Reply #6 on: July 03, 2015, 04:09:50 AM »
The last two arguments of the vla-getBoundingBox function are quoted variables. After running the function these variables will contain the coordinates of the corners of the bounding box.
Code - Auto/Visual Lisp: [Select]
  1. (vlax-invoke (vlax-ename->vla-object e) 'getboundingbox 'ptMin 'ptMax)
  2. (print ptMin)

lamarn

  • Swamp Rat
  • Posts: 636
Re: Modifing insertion point for Revit DWG block output
« Reply #7 on: July 05, 2015, 04:08:16 PM »
In the first post I attached my .lsp file in an attempt to get this working.

Code: [Select]
(if (= 'ename (type ent))
 
;; (vlax-invoke (vlax-ename->vla-object e) ; how does this work exactly?
   
        (progn
 
  (vla-getboundingbox ent 'minpoint 'maxpoint)                  ; something like it, but will not work on block definition
  (vlax-safearray->list minpoint) ; will not work on blocks
  (print minpoint) ; will not work on blocks
  (setq nbp minpoint) ; that would be the idea

Design is something you should do with both hands. My 2d hand , my 3d hand ..

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Modifing insertion point for Revit DWG block output
« Reply #8 on: July 05, 2015, 05:45:33 PM »
Certainly possible - I'll take a look when I get some time.

Please be patient  :-)

lamarn

  • Swamp Rat
  • Posts: 636
Re: Modifing insertion point for Revit DWG block output
« Reply #9 on: July 06, 2015, 12:59:09 AM »
Ok !!! 😅
Design is something you should do with both hands. My 2d hand , my 3d hand ..

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: Modifing insertion point for Revit DWG block output
« Reply #10 on: August 01, 2015, 05:35:31 PM »
Please try my new Justify Block Base Point program  :-)

lamarn

  • Swamp Rat
  • Posts: 636
Re: Modifing insertion point for Revit DWG block output
« Reply #11 on: August 02, 2015, 05:01:33 PM »
There are some wishes left in regards to select similar blocks with different names but JBP really helps working with DWG blocks from Revit.
Now quite easily blocks can be replaced. See this little demo

https://www.youtube.com/watch?v=qieQbNgFrXE
Design is something you should do with both hands. My 2d hand , my 3d hand ..