PDA

View Full Version : Style By Object?



truevis
2008-01-18, 06:04 PM
I have a linked DWG that started life in Revit. When I do a query on a line, the dialog tells me it has "Style By Object" other lines are "Style By Layer". Query also highlights a bunch of lines, not the individual line. In the DWG, these are just lines, not plines.

The problem is that we cannot find a way to override the display of these "Style By Object" DWG elements.

Any ideas on how to get those DWG lines to behave normally? Or, how to control their color when in Revit?

PS: Revit 9.1 and 2008, it's the same problem.

truevis
2008-01-18, 07:31 PM
The answer seems to be that ACAD objects with their lineweight and linetype set to other than BYLAYER cannot have their display changed in Revit (except halftone the whole thing).

Here is an app to fix the DWGs.

;;;Changes all objects to lineweight bylayer and linetype bylayer
(defun c:objects2bl (/ bclctn itemb items)
(vl-load-com)
(setq bclctn (vla-get-blocks
(vla-get-activedocument (vlax-get-acad-object))))
(vlax-for itemb bclctn
(if (= (vlax-get-property itemb 'isxref) :vlax-false)
(vlax-for items itemb
(vl-catch-all-apply 'vlax-put-property
(list items 'lineweight aclnwtbylayer))
(vl-catch-all-apply 'vlax-put-property
(list items 'linetype "BYLAYER"))
; check if has attributes
(if (vlax-property-available-p items 'hasattributes)
(progn
(foreach x
(safearray-value
(variant-value (vla-getattributes items)))
(vlax-put-property x 'lineweight aclnwtbylayer)
(vlax-put-property x 'linetype "BYLAYER")))))))
(vla-update (vlax-get-acad-object))
(princ "\nRegenerating drawing...")
(command "_.regenall")
(princ))