Hello
With Prostructures, when creating an acis model to share with the client or project engineer responsible for the projectit would be good to be able to divide the structure on autocad layers with the same names in Display Classes
example columns in column layersbeams in layer beams etc..
this would certainly make it easier for the responsible designer to consult
to do this you would need to read the class namescreate layers in autocadturn off all classesactivate one class at a time, create solids acisand place the class elements in the layer with the class name.
I ask is it possible to create a macro that does this?
I only know autolisp or visual lispI consulted the com functions but I can't find how to read class names in display class
can someone help
Thank you
For Displayclasses to access you need the ProStructuresnet.dll
The library is explained at
I am also forwarding your request to a colleague who has done some tools here.
Bentley Structural YouTube Channel
Bentley Technical Support
Johannes Michalowsky
User Success Support - Bentley Systems
ServiceRequest Manager
here is the working lisp,you need to hide all objects which are not solid of prosteel like grid, lines, texts etcyou create the layers that will be white in color in layer assign the color you want
the commands Autocad are in Italian and will have to be modified in your language
ciao
(defun LM:Unique ( l ); Thanks to www.lee-mac.com/programs.html (if l (cons (car l) (LM:Unique (vl-remove (car l) (cdr l))))));defun(defun c:LayerDisplayClass ( / ); acadapp shapeinfo ss n_ogg DisplayClassName(vl-load-com)(setq ListDC nil listDCU nil)(setq acadapp (vlax-get-acad-object))(setq shapeinfo (vla-getinterfaceobject acadapp "PSCOMWRAPPER.Ks_ComShapeInfo" ))(setq ss (ssget))(setq n_ogg (sslength ss))(setq count 0)(setq ent (ssname ss count ))(setq shapeinfo (vlax-ename->vla-object ent))(princ "\nYou need to hide all objects which are not solid of prosteel like grid, lines, texts etc.. \n")(setq DisplayClassName (vlax-get-property shapeinfo 'DisplayClassName))(setq ListDC (list DisplayClassName))(repeat (- n_ogg 1)(setq count (+ count 1))(setq ent (ssname ss count ))(setq shapeinfo (vlax-ename->vla-object ent))(setq DisplayClassName (vlax-get-property shapeinfo 'DisplayClassName))(setq ListDC (append listDC (list DisplayClassName))));repeat(setq ListaLayer (LM:unique listDC))(setq n_layer (length ListaLayer))(setq count 0)(Command "-Layer" "N" (nth count ListaLayer)"")(Repeat (- n_layer 1) (setq count (+ count 1)) (Command "-Layer" "N" (nth count ListaLayer)"")) (princ)(princ)(princ)(setq n_ogg (sslength ss))(setq count 0)(setq ent (ssname ss count ))(setq shapeinfo (vlax-ename->vla-object ent))(setq DisplayClassName (vlax-get-property shapeinfo 'DisplayClassName))(command-s "_cambia" ent "" "P" "La" DisplayClassName "")(repeat (- n_ogg 1) (setq count (+ count 1))(setq ent (ssname ss count ))(setq shapeinfo (vlax-ename->vla-object ent))(setq DisplayClassName (vlax-get-property shapeinfo 'DisplayClassName))(command-s "_cambia" ent "" "P" "La" DisplayClassName ""))(princ)(princ)(princ))
This snippet goes through all display classes and switches the visibility to On.
Dim DisplayClassIndex As Long
Dim DisplayClassCount As Long
Dim DisplayClassData As New Bentley.ProStructures.Assignment.PsDisplayClassManager
DisplayClassCount = DisplayClassData.Count
If DisplayClassCount > 0 Then
For DisplayClassIndex = 0 To DisplayClassCount - 1
DisplayClassData.ShowList(DisplayClassIndex)
Next
End If
Hello Carry
It not working for me . Could you tell me what I do wrong. Thx
"Layer "EXISTING_TRUSS" already exists.Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]:Command: ; error: Unknown (command-s) failure."
HII don't know which version of Autocad and Prostructures you use.I don't even know what Layer configuration you use.If you write the lisp code here and point out where the error is, maybe I can help you.I can give you some advice:Make a copy of the model you want to export in acis.Clear all layers that are not from Prostructures.Leave only the solid Prostructure layers of profiles and plates and bolts.
Command: ; error: Unknown (command-s) failure."Try removing the -s and just leave command.Replace _change with ChangeLet me know
sorry for my bad English
Answer Verified By: Johannes Michalowsky