Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

I'm working with a lot of legacy 2D DXF drawings and the imported lines are not constrained.

I'm wondering if there's a way I could generate constraints based on the geometry of an imported sketch. For example If i import a rectangle and change the length dimension, how do i make the rectangle to behave like a constrained rectangle instead of dimensionalizing just 1 line at a time.
Tagged:

Answers

  • mahirmahir Member, Developers Posts: 1,307 ✭✭✭✭✭
    I'm not aware of any autocontstraint functionality at the moment. Maybe in the future? For now, you can just select everything and add a fix constraint. For the simple rectangle example, you can add a dimension to the two parallel lines adjacent to the side you're lengthening. That would apply an implicit parallel constraint and probably keep recangle rectangular.
  • jacob_luetkemeyerjacob_luetkemeyer Member Posts: 8
    Thank you for your feedback! Although that would fix my problem with the rectangle, most of my DXF files are more complicated. My company has over 6000 dxf files that we would like to import into onshape. Most of which are not basic geometric shapes.
        Not only are the lack of constraints an issue but we have double lines, points not connected with a gap of <.0001"
    Re-working the sketches is at the time our best option but I'm hoping to find a more automated approach.
  • 3dcad3dcad Member, OS Professional, Mentor Posts: 2,475 PRO
    +1 for perfect 2d dxf/dwg handling in drawings
    //rami
  • brucebartlettbrucebartlett Member, OS Professional, Mentor, User Group Leader Posts: 2,141 PRO
    +1 for improved dxf import into the sketcher. 

    @dave_cowden posted in another thread that he had worked out a solution to get better quality DXF files into Onshape for a featurescript library he's work on, this maybe of some help but ultimately we want this in the standard issue of Onshape.
    Engineer ı Product Designer ı Onshape Consulting Partner
    Twitter: @onshapetricks  & @babart1977   
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    Yes, i solved the not matching problem-- I had to to import like 1000 DXFs.  The problem, I found, comes in with the fact that DXF represents arcs as center/start-angle/end-angle. this leads to the possibility of errors, because the end points in the adjoining segments are slightly different in the file, and you get precision problems.
  • jacob_luetkemeyerjacob_luetkemeyer Member Posts: 8
    @dave_cowden I've seen the feature script for the profile generators and I'd like to say that's a fantastic tool and an impressive use of featurescript. Now if I could only get my 6000 DXF files into OS without going through generous amounts of time rebuilding the drawings. If there is any featurescript or external tools that someone could direct me to it would be a huge help. Simply stated, there needs to be an automated way to "clean up" the DXF files we import.   
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    Ha, yes there is. I have written such a tool.  I did about 2k of them to do the profile generators.  Why dont you send me a PM and we can work out the details.  I'm sure we can work something out. 
  • lougallolougallo Member, Moderator, Onshape Employees, Developers, csevp Posts: 2,005
    @jacob_luetkemeyer Currently we do not try to recreate constraints upon import.  I have added you to the improvement.
    Lou Gallo / PD/UX - Support - Community / Onshape, Inc.
  • steven_van_luchene848steven_van_luchene848 Member Posts: 122 PRO
    any news on this? an easy way to add constraints to imported 2D drawings would prove very handy (even if it's an "at your own risk") option ;-) 

  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    Hi @stvnvl_8501,
    The code I wrote did not solve the problem by allowing added constraints. That would indeed be cool. I was simply importing the dxf, and then converting individual line segments and arcs with almost matching endpoints to polylines and then trying bto close them. In practice, I found that the dxfs exported for 80/20 and many standard steel profiles needed this treatment.

    What you ended up with in in shape was still a completely unconstrained sketch.. it just had the end points connected correctly.
Sign In or Register to comment.