How to speak with
HTML-код
- Опубликовано: 2 окт 2023
- Join me in this exhilarating tutorial where we dive into the fascinating world of AutoCAD and explore how to unleash the power of the ezdxf library. With python and the magical combination of chatgpt, we'll unlock the secrets of automating tasks and revolutionize our experience with AutoCAD. Prepare to be amazed as we discover the endless possibilities and create stunning designs with ease. Let's embark on this thrilling journey together! #PythonPower
nice video! are you using MicroSoft visual studio? if so how do i get the icons on the left side?
Yes its visual studio, go to menu -> view -> appearance -> Activity Bar Position -> Default
@ahmedskullab thank you very much sir!!
@@ahmedskullab i finally got a chance to change the appearance, but when i select view and scroll down appearance is not listed. this is supposed to be in the View dropdown menu, right? thank you in advance for your help!
Hi. Thanks for the inputs. Is there some way to save dxf files into svg files using ezdxf or any other library?
Use svgwrite
pypi.org/project/svgwrite/
you could use ezdxf library to read the file and svgwrite to create the SVG.
"Hello friend, great video! I have a question about Pyautocad. I need to draw a line using two points, which will be selected within the Autocad drawing. I've read the documentation and there's 'get.selection', but it only works with objects, not points. Do you know how I could solve this? Thank you!"
Hey there,
Thank you for your kind words and your question!
I am having some thoughts how to work around it but need to access my machine to try it first. Currently not having access to my computer! I will let you know. I can imagine how this can be easily managed in the ezdxf library as you could iterate on these points.
Hey sir, resolved using Utility.GetPoint(), see full code below for connecting two points with a line
import time
from pyautocad import Autocad, APoint
# Initialize the connection to AutoCAD
acad = Autocad()
time.sleep(3)
acad.doc.Utility.Prompt("Hello from PyAutoCAD!
")
def get_point_from_user(prompt_text="Select a point: "):
acad.doc.Utility.Prompt(prompt_text)
while True:
try:
point = acad.doc.Utility.GetPoint()
return APoint(point)
except Exception as e:
if 'Call was rejected by callee' in str(e):
continue
else:
raise
def draw_line_between_points(point1, point2):
"""
Draw a line in AutoCAD between two APoint points.
"""
acad.model.AddLine(point1, point2)
if __name__ == "__main__":
# Ask the user to pick two points
start_point = get_point_from_user("Select the start point: ")
end_point = get_point_from_user("Select the end point: ")
# Draw the line
draw_line_between_points(start_point, end_point)
An amazing tutorial. You should be more well known. I would recommend two things for it. First, Title your videos right. Second, Create better thumbnails.
Thank you for your feedback, yea I am working on it 😅
bro why I am not getting elements from 2nd quadrant using ezdxf? I have some required elements in 1st quadrant too.
this is strange, you should be able to! I assume you mean X coordinates are negative, and Y coordinates are positive?
@@ahmedskullab yes
Thank you@@niranjantamhane3602 If you're not seeing elements from the 2nd quadrant, it could be due to the selection criteria or how the coordinate system is interpreted in the script. Make sure your selection logic includes elements with negative X and positive Y values. Also, check for any transformations that might affect element positions. If you're still stuck, feel free to share a snippet of your code, and I'll do my best to help out!
@@ahmedskullab thanks!
Bro how to use it for dwg file?
Thank you, there alternative is pyautocad
You could also use both in the same script
@@ahmedskullab thanks