Hi,
I encounter the following problen, which I unfortunately cannot solve:
I have a DWG-File containing 13 closed polylines (see the figure).
After I import the file into Revit, some of the polylines are sticked together and will be recognized as one line in case of a query. E. g. these two:
You find both dwg-file and rvt-file attached.
The background of my question ist that I want to work with the geometry of these 13 closed polylines. But revit reconizes fewer than 13 polylines.
I would be grateful of any help?
Make each polyline a block.
Wouldn't separate layers for each polyline do the same thing?
yes and thank you.
But actually if I have thousands of such polygones I have to go through them one by one and it's very time consuming.
But thank you any way.
I think it is a fundamental problem of Revit.
@babysatch wrote:
yes and thank you.
But actually if I have thousands of such polygones I have to go through them one by one and it's very time consuming.
But thank you any way.
I think it is a fundamental problem of Revit.
Here is another way to make them come in Revit as individual objects a lot faster. See below:
Hi ToanDN,
thank you so much for your screen cast. Actually I want to get the curves (closed polylines) out of the imported instance in Dynamo in order to creat floors. But I've noticed once you convert them into regions, block or what so ever the recognition of those elements in Dynamo fails and it returns an empty list.
The only way I know of is to put every closed polyline on a seperate layer, which is also time consuming, by the way many thanks to @Sahay_R. It would thus be nice to know how I could do it with a lisp routine which automatically counts the objects, creates so many layers and the then assign each polyline to one of those layers uniquely.
Hi,
An option would be to workaround this situation through setting the polylines (or at least one from the problematic pairs) to a different layer. Polylines from different layers won't be merged together in Revit.
Kind regards,

Dear Orsolya,
Apologies for the somewhat late reply, but I am a bit behind in my reading of this forum. The attached AutoLISP file defines a command function, PLLYR, that will process all of the main-object LWPOLYLINES (the "newer" light-weight polylines) in a drawing regardless of whether they are in Model Space or Paper Space and put each on a unique layer. Polylines nested within a Block Reference are ignored. The layer names start with "PLL" followed by numeral characters from 1 to the number of polylines in the file. The numeral characters are zero-padded, so each layer name has the same number of characters. Examples: for eight polylines, the layers would be PLL1 through PLL8. For 49 polylines, the layers would be PLL01 through PLL49. For 1287 polylines, the layers would be PLL0001 through PLL1287. No attempt is made to set any specific layer attributes (color, linetype, lineweight, etc.); default values are assigned for each.
If your requirements vary from the above, you could always edit the code to suit. In particular, if you already have layers that start with "PLL" followed by numerals (or just do not want the layers to start with "PLL"), you could edit the "PLL" string in the edata (subst (cons 8 (strcat "PLL" (zeropad icount ichar))) line and substitute whatever initial layer name characters you want.
(defun C:PLLYR ( ; No arguments.
/ ;_ Local variables:
edata ; Entity data of polyline being processed [association list].
ename ; Entity name of polyline being processed.
icount ; Current polyline being processed [integer].
ichar ; Number of characters required for total number of polylines [integer].
imax ; Total number of polylines to process [integer].
sspl ; Polylines in drawing [selection set].
zeropad ; Local subroutine to generate zero-padded string.
) ;_ End arguments and local variables.
(setq acmde (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
;;;************************************************************************
;;;* Local subroutine to generate zero-padded string. *
;;;************************************************************************
(defun ZEROPAD ( ;_ Arguments:
inum ; Number to be converted to zero-padded string [integer].
ichar ; Number of characters in zero-padded string [integer].
/ ;_ Local variables:
ilen ; Number of characters in integer to be converted [integer].
snum ; Integer to be converted as a string [string].
) ;_ End arguments and local variables.
(setq snum (itoa inum) ; String equivalent of integer to be converted.
ilen (strlen snum) ; Length of integer string.
) ;_ End setq.
(cond ; Condition A.
((>= ilen ichar) ; Integer string length is greater than or equal to the padded string length.
snum ; Return integer string, as is.
) ;_ End condition A1.
(T ; Otherwise, process integer string.
(while (< ilen ichar) ; While integer string length is less than target length...
(setq snum (strcat "0" snum) ; ...add "0" to front of string and...
ilen (1+ ilen) ; ...increment string length.
) ;_ End setq.
) ;_ End while.
snum ; Return final string.
) ;_ End condition A2.
) ;_ End condition A.
) ;_ End ZEROPAD.
;;;************************************************************************
;;;* Start of main routine. *
;;;************************************************************************
(setq sspl (ssget "X" '((0 . "LWPOLYLINE")))
; Get all LWPOLYLINE objects in drawing.
imax (sslength sspl) ; Nunber of polylines in selection set.
ichar (strlen (itoa imax)) ; Number of characters in polyline number.
icount 0 ; Initialize polyline counter.
) ;_ End setq.
(while (setq ename (ssname sspl icount))
; While unprocessed polylines remain, do the following.
(setq icount (1+ icount) ; Increment polyline counter.
edata (entget ename) ; Get polyline data.
edata (subst (cons 8 (strcat "PLL" (zeropad icount ichar)))
(assoc 8 edata)
edata
) ; Update data for new layer name.
) ;_ End setq.
(entmod edata)
) ;_ End while.
(setvar "CMDECHO" acmde)
(prin1)
) ;_ End C:PLLYR.
I did not test this routine on a wide variety of files (only on one test file, that did not have much other than LWPOLYLINES and a few viewports in it), so I would recommend working on a copy of your original files so you still have the original should something go awry.
After thinking about the ZEROPAD subroutine a little more this morning, I realized that the cond statement really was not needed; the test in the while statement would effectively prevent entering the while loop if the integer passed already had as many (or more) characters as indicated in the second argument. Here is the streamlined version:
(defun C:PLLYR ( ; No arguments.
/ ;_ Local variables:
edata ; Entity data of polyline being processed [association list].
ename ; Entity name of polyline being processed.
icount ; Current polyline being processed [integer].
ichar ; Number of characters required for total number of polylines [integer].
imax ; Total number of polylines to process [integer].
sspl ; Polylines in drawing [selection set].
zeropad ; Local subroutine to generate zero-padded string.
) ;_ End arguments and local variables.
(setq acmde (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
;;;************************************************************************
;;;* Local subroutine to generate zero-padded string. *
;;;************************************************************************
(defun ZEROPAD ( ;_ Arguments:
inum ; Number to be converted to zero-padded string [integer].
ichar ; Number of characters in zero-padded string [integer].
/ ;_ Local variables:
ilen ; Number of characters in integer to be converted [integer].
snum ; Integer to be converted as a string [string].
) ;_ End arguments and local variables.
(setq snum (itoa inum) ; String equivalent of integer to be converted.
ilen (strlen snum) ; Length of integer string.
) ;_ End setq.
(while (< ilen ichar) ; While integer string length is less than target length...
(setq snum (strcat "0" snum) ; ...add "0" to front of string and...
ilen (1+ ilen) ; ...increment string length.
) ;_ End setq.
) ;_ End while.
snum ; Return final string.
) ;_ End ZEROPAD.
;;;************************************************************************
;;;* Start of main routine. *
;;;************************************************************************
(setq sspl (ssget "X" '((0 . "LWPOLYLINE")))
; Get all LWPOLYLINE objects in drawing.
imax (sslength sspl) ; Nunber of polylines in selection set.
ichar (strlen (itoa imax)) ; Number of characters in polyline number.
icount 0 ; Initialize polyline counter.
) ;_ End setq.
(while (setq ename (ssname sspl icount))
; While unprocessed polylines remain, do the following.
(setq icount (1+ icount) ; Increment polyline counter.
edata (entget ename) ; Get polyline data.
edata (subst (cons 8 (strcat "PLL" (zeropad icount ichar)))
(assoc 8 edata)
edata
) ; Update data for new layer name.
) ;_ End setq.
(entmod edata) ; Update polyline.
) ;_ End while.
(setvar "CMDECHO" acmde)
(prin1)
) ;_ End C:PLLYR.
Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.