Jump to content

Prostructures the Display Classes in Layer to Autocad


Recommended Posts

Posted

Hello

With Prostructures, when creating an acis model to share with the client or project engineer responsible for the project
it would be good to be able to divide the structure on autocad layers with the same names in Display Classes

example columns in column layers
beams 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 names
create layers in autocad
turn off all classes
activate one class at a time, create solids acis
and 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 lisp
I consulted the com functions but I can't find how to read class names in display class

can someone help

Thank you

Posted (edited)

Hello

I analyze all the properties of the objects in the drawing e
I create a list with the "DisplayClass" property
I delete all duplicates from the list and I have them left
the names of the DisplayClasses with which I can create the layers.
that's something already...
  but if someone helps it would create more understandable acis files.
Thanks

 

(defun c:ListDiplayClass ( / ); acadapp shapeinfo ss n_ogg DisplayClassName)
(vl-load-com)
(setq acadapp (vlax-get-acad-object))
(setq shapeinfo (vla-getinterfaceobject acadapp "PSCOMWRAPPER.Ks_ComShapeInfo"  ))

(setq ss (ssget "X" ' ((8 . "PS_profilo")))) ; autocad layer where the beam profiles are created
(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))
(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

)

 

Edited by carry
Posted

here is the working lisp,
you need to hide all objects which are not solid of prosteel like grid, lines, texts etc
you create the layers that will be white in color in layer assign the color you want

 

(defun LM:Unique ( l ); Thanks to http://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")
;   (princ "\nDevi nascondere tutti gli oggetti che non sono solidi di prosteel come la griglia, linee, testi ecc   \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)
)

 

Posted (edited)

Why not do it right 1st and set the layer the draw a Column etc. You can make a shortcut that sets layer then calls column command, no idea how prosteel works.

 

For me in a big package we allowed users to edit a layer file so set layers that objects were drawn on that way always correct. Does prosteel have something like this very odd that it doesn't.

 

 

Edited by BIGAL

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...