Select solids by face color?

2»

Comments

  • @James Maeding said:

    I keep thinking though, can't eaglecad produce a dxf or dwg?
    I need to read your past posts, but am thinking if its traces on a board, maybe you get the 2d linework from eaglecad, and pull into bcad and extrude.
    Like make the 3d thing from the 2d info.

    Thanks again James (or do you go by Jim?). Yes, The project engineer exported a DXF with multiple layers for me. But I had no end of problems with it. The layers wouldn't extrude without an enormous amount of manual work. I had to borrow another LISP program (AdvancedPolyOutline to trace the borders of the polylines and convert them to polygons. Unfortunately that program leaves lots of polygons that aren't closed, or are too small (according to the support group) to extrude. Even after I closed or removed all the open polygons I could find, and scaled by a factor of 10, the extrude operations kept failing. I did not know why. The error messages were cryptic to me. My machines at work and home are very slow. Typically, it takes about 5 - 8 minutes just to extrude a batch of 50 or 75 polygons.

    The *.BRD the project engineer sent me is a 3D model of the PCB.. I imported it with FreeCAD but the export to STEP puts all the physical layers (silkscreen, top copper, masks, etc). on Layer O The solids are differentiated by face colors. That is why I need to be able to select solids by face color.

    I have asked our IT manager, who has some limited knowledge of C#NET to give me some help.

  • @Jim Canale said:
    I feel so stupid listening to you guys.....

    @Jim Canale
    Maybe you can fix our vacuums some time in return. They get hair clips and stuff stuck in the tubes.

  • Jim you don't need any knowledge of C#NET , i have just described the functionality of the programs attached.
    You can practically load the programs in 2 alternative ways:

    1. ( the best way already described in my message)
      Load both attached programs using the command APPLOAD and check Loaded and Autoload
      to have the programs automatically loaded in every Bricscad session and drawing.
      Then call the command SBFC and proceed...
    2. Use the NETLOAD command to load the file GetFaceInfo_BC.dll
      LOAD the lisp file and then call the command SBFC

    I have seen you DWG files, it contains 498 Solids and 90 Surfaces (white)
    The solid Faces have only 3 colors "184,115,51" "white" "0,107,0" so you will need 3 Layers

  • As a GUI guy I also played a bit with the file and I took a look at
    Structure Browser and went through all Filters.
    There are some options for sorting by color but also nothing that
    could select or separate by Face Colors ....

    I also tried importing the DWG into Vectorworks.
    I won't even see any colors there.
    Just everything white and on Layer 0.

  • Roy Klein Gebbinck
    edited April 2020

    @Jim Canale The code I have posted (here) works fine on your DWG. See the attached animation.

  • @Jim Canale
    I go by James...
    Your IT guy will have no clue of using a dll in bcad.
    Normally a dll is called by other programs, not like directly loaded into a program.

    For the plines you got from dxf and tried to extrude:
    Yes, making clean plines involves bags of tricks. I've been doing *CAD (sub in A or B) for 25 years now and have yet to find a perfect tool.
    I've written several version of my own and know its tricky. Everything needs it too, cad, GIS, quantities, 3dmodeling, you name it.
    I'd be interested in trying my tricks if you send a dwg/dxf.
    I'm at jmaeding ** hunsaker ** com. Sub in @ and .
    thx

  • I attach your DWG separated in 4 Layers for Solid Faces with the existing colors "184,115,51" "white" "0,107,0" and Surface as a proof of concept !imageimageimageimage

  • @Roy Klein Gebbinck said:
    @Jim Canale The code I have posted (here) works fine on your DWG. See the attached animation.

    I miss a Like! button here ....

  • I can't keep up with you guys.... (I've got other work to do besides CAD, and was shuttling back and forth to work yesterday, even though I'm supposed to be working from home. )

    Thanks to everyone here. Very knowledgeable and smart group. I need some time to slowly digest this.

  • @Roy Klein Gebbinck said:
    @Jim Canale The code I have posted (here) works fine on your DWG. See the attached animation.

    Roy,

    I don't get it! Yesterday I couldn't get the thing to work for the life of me. Today it works just fine. Must've been the system restart last night. Thank you very much. This will be very helpful in dealing with those imports from Eagle.

  • @Konstantin Sakellaris said:
    I am attaching a new version of the file GetFaceInfo_BC.dll after having corrected a small bug....

    Konstantin,
    Thank you. I am trying to digest everything you posted. Very difficult for me... My understanding is that the library you posted provides additional functionality that can be accessed by a LISP routine. It creates a list which associates face properties with their solids. And the LISP routine you provided queries the list for objects having certain face colors.

    I used APPLOAD to load your *.LSP I could not get the *.DLL loaded this way, so I used NETLOAD as James suggested. When I select an object and invoke SBFC, the response is: (NIL )

    Does this mean the *.dll is not properly loaded, or am I using SBFC incorrectly? Curious as to where the list provided by the function resides.

  • @James Maeding said:

    @Jim Canale said:
    I feel so stupid listening to you guys.....

    @Jim Canale
    Maybe you can fix our vacuums some time in return. They get hair clips and stuff stuck in the tubes.

    Vacuums? Tubes?

  • @Jim Canale said:

    @James Maeding said:

    @Jim Canale said:
    I feel so stupid listening to you guys.....

    @Jim Canale
    Maybe you can fix our vacuums some time in return. They get hair clips and stuff stuck in the tubes.

    Vacuums? Tubes?

    Yah, you said you used to mess with vacuum tubes, something like that :)

  • @Jim Canale said:

    @Konstantin Sakellaris said:
    I am attaching a new version of the file GetFaceInfo_BC.dll after having corrected a small bug....

    Konstantin,
    Thank you. I am trying to digest everything you posted. Very difficult for me... My understanding is that the library you posted provides additional functionality that can be accessed by a LISP routine. It creates a list which associates face properties with their solids. And the LISP routine you provided queries the list for objects having certain face colors.

    I used APPLOAD to load your *.LSP I could not get the *.DLL loaded this way, so I used NETLOAD as James suggested. When I select an object and invoke SBFC, the response is: (NIL )

    Does this mean the *.dll is not properly loaded, or am I using SBFC incorrectly? Curious as to where the list provided by the function resides.

    I think you are doing it right, there is some small snag going on.
    The SBFC should select faces. I did not look at the lisp closely.
    Oh, try using "last", after the SBFC runs.
    So maybe, Move, L, enter, and see what it selects.
    We commonly select stuff in a lisp, and use Last for next command.
    thx

  • Jim,

    What version of Bricscad are you using ? My version is V20 x64 on Windows 10 x64

    Then try the following:
    Type in the command line
    ( nl-getfaceinfo (ssget) ) hit return
    then select the entity shown with the red arrow in the screenshot below...i have used your posted dwg file ( Screenshot 1 )
    and again hit return to end the selection
    You should get in the command line the list of this solid

    Select entities:
    Entities in set: 1
    Select entities:   (hit enter)
    ((<Entity name: 5434aa30> "1AAF" (1 "Surface" 0.893491318575294 0.000614645035505485 (184 115 51) "184,115,51") (2 "Region" 0.446056682909694 0.0158332561146213 (0.0 0.0 -1.0) (184 115 51) "184,115,51") (3 "Region" 0.446056682909694 0.0158332561146213 (0.0 0.0 1.0) (184 115 51) "184,115,51")))
    

    If you do get the list
    then call the command SBFC and select all the solids in the file or some solids to save time (wait until selected)
    hit return button to end the selection
    then enter a color from the existing ones , for example "184,115,51" or "white" or "0,107,0" without quotes(" ")
    Then hit return button...
    The solids should be selected ! Screenshot 2 and you can change them to a new Layer....
    If not then we talk again !

    image

    image

  • @Konstantin Sakellaris

    Konstantin,

    Thank you again. Appreciate the fact that you, Roy, and James are willing to give your valuable time up to solve my problems.

    I am using V19.

    I DO get a list when I run the function ( nl-getfaceinfo (ssget) ) directly from the command line. (I thought your LISP program would do that for me...) Anyway, after generating the list, I immediately called SBFC, selected ALL the objects in the file, and hit ENTER. BricsCAD crashed.

    I restarted BricsCAD and repeated the function, This time, after invoking SBFC, I selected a much smaller set of objects. The program did NOT crash. I entered my color and the solids I wanted were selected. Good!

    I repeated the test with the larger selection set, and again, BricsCAD crashed. But I just noticed that within the huge set of solids on layer 0, are some surfaces. Perhaps this caused the issue, and I will have to filter the surfaces to another layer before executing your code?

    Anyway, I have just a couple hours left to generate some work for my employer before I have to sign off. Roy's Lisp file is working fine for what I am doing, but if your function offers me additional capability, I want to understand how and when to use it. Can we take this up on next weeks sometime?

  • It could be that the Bricscad version causes crash problems because the DLL file has binary dependencies to the DLL library files of Bricscad.
    But it is not your problem. I don't have any installed V19, mine is V20 , so i will install one next week and attach a GetFaceInfo_BC.dll compiled
    for the V19. Then you can try again i and relaxed if the crash problem remains....I am glad to hear that Roy's solution is working fine for you !
    I would appreciate if someone out there could test and inform me on possible problems!
    Have a nice weekend !

  • @Konstantin Sakellaris said:
    It could be that the Bricscad version causes crash problems because the DLL file has binary dependencies to the DLL library files of Bricscad.
    But it is not your problem. I don't have any installed V19, mine is V20 , so i will install one next week and attach a GetFaceInfo_BC.dll compiled
    for the V19. Then you can try again i and relaxed if the crash problem remains....I am glad to hear that Roy's solution is working fine for you !
    I would appreciate if someone out there could test and inform me on possible problems!
    Have a nice weekend !

    Konstantin,

    I am always amazed at the support I get from the forum, including you, Roy, James and so many others. I don't know what you all get out of it. I'm sure you would all like to be pursuing your own interests instead of helping a greenhorn like me. I don't have anything of value in the way of experience to return to the discussion. No programming experience. You don't have to go to the trouble of installing V20 and getting that library re-compiled. I have Roy's code, which for the present time, will do what I want it to do... But if it's something you're interested in, and don't mind doing it, I'd like to see what you can come up with. It could very well bail me out of a jam in the future.

    Keep safe.

    Jim Canale

  • dereckbabcat
    edited November 2020

    I also looking for a solution for alternatives to Autodesk Maya... any recommendation, please. I found only this review https://alternativemaster.com/alternatives-to-autodesk-maya

  • @dereckbabcat
    This came up back when adesk stopped selling perpetual software seats. The Maya and Max crowd went to Blender and Rhino I think. You can check out the adesk groups on that. Funny how you have to go to their group to find out how to leave their software.