[git] refusing to merge unrelated histories
When uploading a new project to Github, an error occurred fatal: HttpRequestException encountered.. Referring to this link to install GCMV still reported this error. I realized it should be because I created a readme on github but didn’t pull it.Entering command git pull -u master reported fatal: refusing to merge unrelated histories. The solution refers to this link. After that, successfully pulled cloud files to local, then entered command git push -u master to upload successfully.
【git】 refusing to merge unrelated histories
新项目上传至Github时出现错误我fatal: HttpRequestException encountered.,参照此链接安装GCMV依旧报此问题的错误,意识到应该是在github创建readme没有进行拉取的问题输入命令git pull -u master报错fatal: refusing to merge unrelated histories,解决方法参照此链接,之后成功将云端文件拉取到本地,之后输入命令git push -u master即可上传成功。
Revit 二次开发 获取多段轴网的location
点开多段轴网会发现轴网类型为MultiSegmentGrid,里面没有Locaiton可以获取,如果想要获取路径可以通过两种方式进行获取方式一:Revit中可以进行编辑草图模式的均可以通过删除构件收集构件ID进行获取相应路径代码可以参照叶雄进的获取板边界文章进行获取方式二:直接Collector收集所有的Grid类型即可,里面同样Name的轴线即为多段轴网 12var list = collector.OfCategory(BuiltInCategory.OST_Grids).ToList();var grids = list.Where(x => x.GetType() == typeof(Autodesk.Revit.DB.Grid)).ToList();
Revit Secondary Development Get Location of Multi-segment Grid
Clicking multi-segment grid will find grid type is MultiSegmentGrid, there is no Location to get inside. If want to get path can get through two waysWay 1:In Revit can edit sketch mode can collect component ID by deleting component to get corresponding pathCode can refer to Ye Xiongjin’s article on getting slab boundary to getWay 2: Directly Collector collect all Grid types, grids with same Name inside are multi-segment grids 12var list = collector.OfCategory(BuiltInCategory.OST_Grids).ToList...
WinForm Method to Override "Close" Button in Upper Right Corner
1234567891011121314protected override void WndProc(ref Message msg){ const int WM_SYSCOMMAND = 0x0112; const int SC_CLOSE = 0xF060; if (msg.Msg == WM_SYSCOMMAND && ((int)msg.WParam == SC_CLOSE)) { // Click close button on winform upper right // Add wanted logic processing return; } base.WndProc(ref msg);} Link Address:Method to judge close event comes from user clicking “Close” button in upper right corner in WinForm
WinForm重写右上角“关闭”按钮的方法
1234567891011121314protected override void WndProc(ref Message msg){ const int WM_SYSCOMMAND = 0x0112; const int SC_CLOSE = 0xF060; if (msg.Msg == WM_SYSCOMMAND && ((int)msg.WParam == SC_CLOSE)) { // 点击winform右上关闭按钮 // 加入想要的逻辑处理 return; } base.WndProc(ref msg);} 链接地址:WinForm判断关闭事件来源于用户点击右上角“关闭”按钮的方法
Revit Dockpane An ItemsControl is Inconsistent with its Item Source
When clicking button in dockable window to upload data in DataGrid today, found that multiple uploads will cause problem An ItemsControl is inconsistent with its item source. Later checking problem found it was due to multi-threading exception causing the problem.Reason should be dockable pane and Revit itself are two processes. Data passing between main process and window caused process error, thus triggering the problem. 1234567891011private ObservableCollection<ExternalProperity.Project...
Revit Dcokpane 某个 ItemsControl 与它的项源不一致
今天再可停靠窗口进行点击按钮从而再DataGrid中上传数据时,发现多次上传会出现问题某个 ItemsControl 与它的项源不一致,后来再查问题时发现是因为由于有多线程异常导致的问题。原因应该是可停靠面板与Revit本身时两个进程,再主进程与窗口之间进行数据传递导致进程错误,从而引发的问题。 1234567891011private ObservableCollection<ExternalProperity.ProjectMessageClass> _messages = new ObservableCollection<ExternalProperity.ProjectMessageClass>();void UpdateItems(ExternalProperity.ProjectMessageClass message) { Dispatcher.BeginInvoke(DispatcherPriority.Background, new ParameterizedThrea...
Get Enum Value and DescriptionAttribute from String
Get Enum Value from String1var em = (ChooseEnum) Enum.Parse( typeof(ChooseEnum), desc); Get DescriptionAttribute from Enum Value12345678910111213141516171819public static string ConvertToSql(Enum value) { Type enumType = value.GetType(); string name = Enum.GetName(enumType, value); if (name != null) { FieldInfo fieldInfo = enumType.GetField(name); if (fieldInfo != null) { D...
根据字符串获得相应枚举值和DescriptionAttribute
根据字符串获得枚举值1var em = (ChooseEnum) Enum.Parse( typeof(ChooseEnum), desc); 根据枚举值获得DescriptionAttribute12345678910111213141516171819public static string ConvertToSql(Enum value) { Type enumType = value.GetType(); string name = Enum.GetName(enumType, value); if (name != null) { FieldInfo fieldInfo = enumType.GetField(name); if (fieldInfo != null) { DescriptionAttribute attribute...
Winform DatagridCombox Bind Data Show Cannot Sort ComboBox with DataSource Set. Please use underlying data model to sort data
Today used winform to create datagridview which bound combox data 1234name.DataPropertyName = "PropertyName"; name.DisplayMember = "pn_name"; name.ValueMember = "pn_id"; name.DataSource = GetNames().Tables[0]; Project reported error: Cannot sort ComboBox with DataSource set. Please use underlying data model to sort dataCompared multiple blogs found my assignment has no problem, saw last sentence use use underlying data, then clicked ...
Winform DatagridCombox绑定数据显示无法对设置了 DataSource 的组合框排序。请使用基础数据模型对数据排序
今天使用winform创建datagridview其中绑定了combox数据 1234name.DataPropertyName = "PropertyName"; name.DisplayMember = "pn_name"; name.ValueMember = "pn_id"; name.DataSource = GetNames().Tables[0]; 项目报错:无法对设置了 DataSource 的组合框排序。请使用基础数据模型对数据排序对照多个博客发现自己的赋值并没有问题,看到最后一句使用使用基础数据,便点开编辑列发现设置sorted为true设置为false后错误消失
revit二次开发 Idling&ExternalEvent 空闲事件与外部事件
Idling&ExternalEvent 空闲事件与外部事件空闲事件 空闲事件是指在revit无操作时执行命令 TheBuildingCoder解释 code 12345678910111213141516171819202122public static void IdlingHandler(object sender, Autodesk.Revit.UI.Events.IdlingEventArgs args) { UIApplication uiapp = sender as UIApplication; if (uiapp != null) { Autodesk.Revit.UI.UIDocument uidoc = uiapp.ActiveUIDocument; Autodesk.Revit.DB.Document doc = uidoc.Document; if (uid...
revit Secondary Development Idling&ExternalEvent
Idling&ExternalEventIdling Event Idling event refers to executing commands when revit has no operation TheBuildingCoder explanation code 12345678910111213141516171819202122public static void IdlingHandler(object sender, Autodesk.Revit.UI.Events.IdlingEventArgs args) { UIApplication uiapp = sender as UIApplication; if (uiapp != null) { Autodesk.Revit.UI.UIDocument uidoc = uiapp.ActiveUIDocument; Autodesk.Revit...
Revit Secondary Development Room Separator ID Duplicate Issue
Today when retrieving room separator lines, found if wall middle end?? has connection with other walls, Will break room separator line, can see room boundary at this location becomes five segmentsItself does not have much impact, but if we click ElementID inside Line to check, will find Element duplicate problem. If developer performs extraction judgment of duplicate line segments here and sets ID as Key, will cause problem of missing line segments==Line segment 4—ID==...
Revit二次开发 房间分割线ID重复的问题
今天在检索房间分隔线时,发现如果墙体中端??与其他墙体有连接,会将房间分隔线断开,可以看到此处位置房间边界变为五段本身并没有什么太大的影响,但是如果我们点开里面Line里面的ElementID进行查看时,会发现Element重复的问题,如果开发者在此处进行重复线段的提起那判断并将ID设置Key会出现少线段的问题==线段4—ID====线段五—ID==
算法第四版 练习题记录
课后题并没有全部做,只是挑出几个无法确定或不能想到结果的进行记录因为之前没有使用过IDEA导致浪费很多时间进行IDE的配置用户调试 算法第四版算法第一章题目概要:检索用户输入”[()]{}{[()()]}”进行相应符号的配对,如果符号无法匹配输出false思路,参考之前书中提到过的算术表达式求值(P79) 通过创建下压栈lops进行记录左侧符号,包含[ { (,如果在读取语句中遇到右侧符号] } ),lops.pop()弹出栈上最上面的值,如果不是左右匹配则输出错误,直至全部循环结束 == 由于jar包里面的类加上IDE使用不熟悉,所以没有进行语句的全部录入并拆解 == code12345678910111213141516171819202122232425262728293031323334353637383940414243public class MainProject { public static void main(String[] args) { StdOut.println...
Algorithms 4th Edition Practice Notes
I didn’t complete all the exercises, just recorded a few where the results were uncertain or unexpected.Since I hadn’t used IDEA before, I wasted a lot of time configuring the IDE for debugging. Algorithms 4th EditionAlgorithm Chapter 1Problem Summary:Retrieve user input “[()]{}{[()()]}” and match the corresponding symbols. Output false if the symbols cannot be matched. Approach:Referencing the arithmetic expression evaluation mentioned earlier in the book (P79), create a push-down stack lops...
C# WPF Smart Selection Dialog
Reference Links:WPF-15: Use of AutoCompleteBox (Implement Dropdown List)WPF: AutoCompleteBox, an autocomplete text boxIf fail to load assembly occurs, rely on this answer Preparation:Download WpfToolKit.dll, System.Windows.Controls.Input.Toolkit.dll or install via NuGet search, download link is in the first blog. Content:FrontendImplement auto-completion or smart selection function via wpftool framework.Add in frontend:xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System....
C# wpf 智能选择对话框
参考链接:WPF-15:AutoCompleteBox的使用(实现下拉列表)WPF: AutoCompleteBox, an autocomplete text box如果出现未能加载程序集,可以参照这篇回答 准备:WpfToolKit.dll,System.Windows.Controls.Input.Toolkit.dll下载或通过nuget搜索安装,下载链接在第一个博客中 内容:前端通过wpftool框架实现自动补全信息或智能选择的功能在前端添加xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"在窗口内实现AutoCompleteBox 1234567891011<toolkit:AutoCompleteBox x:Name="searchTextBox" Grid.Row="1" ValueMemberPath="SerchString" ...



